Division by Zero - Overflow

I need to perform a calculation (diving two values), and I cant get it work. The reason is that some values in the table are 0 (zero), and when it divides Zero by Zero I get the "overflow" error. I tried with a condition:

 IIf([B_Diff.A1]=0,0,Sum([B_Diff.A1]/[B_All.A1]))

and that does not seem to work. In fact it does not respect the condition that if 0, write 0. I would rather prefer a condition: if Zero do not performn the calculation and set value to zero.
Can that be done?
EdS45Asked:
Who is Participating?
 
ThomasianConnect With a Mentor Commented:
Here you go

Nz(Sum([B_Diff].[A1]/IIf([B_All].[A1]<>0,[B_All].[A1])),0)

Open in new window

0
 
EdS45Author Commented:
Excellent. Thanks
Ed
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.