Link to home
Start Free TrialLog in
Avatar of jlcannon
jlcannon

asked on

making a percentage from values.

I have a table that has several fields that have either yes or no in them. I want to know how I can on a report count the number of no's and show that as a percent.. so lets say there are 100 yeses or no's and of that 25 are no's I want to be able to show 25% no's on the answers.
ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jlcannon
jlcannon

ASKER

ok well when I use this:
=Sum(IIf([YesNo1] = "No", 1, 0) + IIf([YesNo2] = "No", 1, 0) + IIf([YesNo3] = "No", 1, 0) + IIf([YesNo4] = "No", 1, 0) + IIf([YesNo5] = "No", 1, 0) + IIf([YesNo6] = "No", 1, 0) + IIf([YesNo7] = "No", 1, 0) + IIf([YesNo8] = "No", 1, 0) + IIf([YesNo9] = "No", 1, 0) + IIf([YesNo10] = "No", 1, 0) + IIf([YesNo11] = "No", 1, 0) + IIf([YesNo12] = "No", 1, 0) + IIf([Yesno13] = "No", 1, 0) + IIf([YesNo14] = "No", 1, 0) + IIf([YesNo15] = "No", 1, 0) + IIf([YesNo16] = "No", 1, 0) + IIf([YesNo17] = "No", 1, 0) + IIf([YesNo18] = "No", 1, 0)) / (Count([Yesno1]) * 18)

I get #error displayed when I run the report
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ok so the control names... ok the fileds in the table are YesNo1 - YesNo18.  What controls am I supposed to name something else.
Start with the one that you are putting your formula in.
--
JimFive
ok well the one that i put the formula in is called SumNo and it is on the report in a textbox
ok so I have the following in an expression in the query:
=Sum(IIf([YesNo1]="No",1,0)+IIf([YesNo2]="No",1,0)+IIf([YesNo3]="No",1,0)+IIf([YesNo4]="No",1,0)+IIf([YesNo5]="No",1,0)+IIf([YesNo6]="No",1,0)+IIf([YesNo7]="No",1,0)+IIf([YesNo8]="No",1,0)+IIf([YesNo9]="No",1,0)+IIf([YesNo10]="No",1,0)+IIf([YesNo11]="No",1,0)+IIf([YesNo12]="No",1,0)+IIf([Yesno13]="No",1,0)+IIf([YesNo14]="No",1,0)+IIf([YesNo15]="No",1,0)+IIf([YesNo16]="No",1,0)+IIf([YesNo17]="No",1,0)+IIf([YesNo18]="No",1,0))/(Count([Yesno1])*18)

and that does return a percentage for each record in the table. what I want is on the report to be able to show the percentage of No's for all records.