Query- Totaling yes answer an the calcuating the percent of the to

  • Thread starter Thread starter EMall
  • Start date Start date
E

EMall

I am trying to created a query that totals the number of "yes" answers in a
data base and then calculates the percent of "yes" versus the total of the
"yes" and "noâ€. My questions in the DB have n/a and TDB as well for choices,
so I need to exclude these in the roll up of question.
 
I am trying to created a query that totals the number of "yes" answers in a
data base and then calculates the percent of "yes" versus the total of the
"yes" and "no”. My questions in the DB have n/a and TDB as well for choices,
so I need to exclude these in the roll up of question.

If the datatype of the field is Text and you want to just consider the literal
text strings "Yes" and "No", try

=Sum(IIF([answer] = "yes", 1, 0) / Sum(Iif([answer] = "yes" OR [Answer] =
"no", 1, 0)

You may need some criteria to eliminate cases where there are no answers
containing either yes OR no - you'll get a divide-by-zero error.
 
Back
Top