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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top