M
Maggie
Hello all,
Query Average question: I'm attempting to average a handful of survey
result values (per record) in a query. For example, Bob answers my survey
and gives me a 4, 4, 3, 3, 4...this shoud average to 3.6. If everyone
answers all questions, no problem. The problem comes in when someone leaves
answers blank. I have a basic Avg set up to add the #s together and divide
by how many questions there are:
1xAvg:
Avg(([SurveyQuestion1Score]+[SurveyQuestion2Score]+[SurveyQuestion3Score]+[SurveyQuestion4Score]+[SurveyQuestion5Score])/5)
But when any of those values are blank, it doesn't calculate anything and
gives me a null answer...AND if I put zeros in the field, the averages are
then incorrect. I'm wondering if there is something I can replace that "/5"
with. Is there some sort of countnum statement that can replace that and
say: "add all these numbers together and divide by the count of values that
are not null"? Any thoughts would be greatly appreciated.
Thanks so much.
Query Average question: I'm attempting to average a handful of survey
result values (per record) in a query. For example, Bob answers my survey
and gives me a 4, 4, 3, 3, 4...this shoud average to 3.6. If everyone
answers all questions, no problem. The problem comes in when someone leaves
answers blank. I have a basic Avg set up to add the #s together and divide
by how many questions there are:
1xAvg:
Avg(([SurveyQuestion1Score]+[SurveyQuestion2Score]+[SurveyQuestion3Score]+[SurveyQuestion4Score]+[SurveyQuestion5Score])/5)
But when any of those values are blank, it doesn't calculate anything and
gives me a null answer...AND if I put zeros in the field, the averages are
then incorrect. I'm wondering if there is something I can replace that "/5"
with. Is there some sort of countnum statement that can replace that and
say: "add all these numbers together and divide by the count of values that
are not null"? Any thoughts would be greatly appreciated.
Thanks so much.