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 & "%"

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

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

ASKER

That doesnt work.

Does that mean you get an error, or that you get unexpected results?

Try this:

Try this:

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

ASKER CERTIFIED SOLUTION

membership

This solution is only available to members.

To access this solution, you must be a member of Experts Exchange.

ASKER

Good job!

pT72

pT72

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