Link to home
Start Free TrialLog in
Avatar of gigifarrow
gigifarrow

asked on

Dividing using DCount

This code divides the answer by 11
 I need to divide 11 by the answer. How do I do that?
for example instead of 2 / 11
 
I need it to show 11/2

=DCount("*","tblMODHistory","[Div] = '170-HBCT'")/11 & "%"
Avatar of IrogSinta
IrogSinta
Flag of United States of America image

Wouldn't that just be =11/DCount("*","tblMODHistory","[Div] = '170-HBCT'") & "%"
Avatar of gigifarrow
gigifarrow

ASKER

That doesnt work.
Does that mean you get an error, or that you get unexpected results?


Try this:
=(11/iif(DCount("*","tblMODHistory","[Div] = '170-HBCT'") =0,1, DCount("*","tblMODHistory","[Div] = '170-HBCT'"))) & "%"

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of pteranodon72
pteranodon72
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
Good job!

pT72
Scratch that about operator precedence. All arithmetic operators go before concatenation.