468,167 Members | 1,882 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,167 developers. It's quick & easy.

Dividing by zero

This is my original equation: =([Total Maintain Exercise]/[Total
Completing 1 mo Follow-up])*100

When the denomimator is zero I am unable to calculate the percentage.

I tried changing my equation to this format:
=IIf([denominator_field] = 0, 0, [numerator_field]/
[denominator_field])

I also tried:

IF(B=0,0,A/B) will give you an answer of 0 if the
denominator is zero or IF(B=0,"",A/B) will give you a blank in the
same
situation.

Any suggestions...I am desperate as I was hoping this would be an EASY
fix!

Thanks!,

John
Oct 17 '08 #1
1 1409
zufie wrote:
This is my original equation: =([Total Maintain Exercise]/[Total
Completing 1 mo Follow-up])*100

When the denomimator is zero I am unable to calculate the percentage.

I tried changing my equation to this format:
=IIf([denominator_field] = 0, 0, [numerator_field]/
[denominator_field])

I also tried:

IF(B=0,0,A/B) will give you an answer of 0 if the
denominator is zero or IF(B=0,"",A/B) will give you a blank in the
same
situation.

Any suggestions...I am desperate as I was hoping this would be an EASY
fix!

Thanks!,

John
Why not use/create a function in a code module?
Function DivideIt(a,b) As Variant
If b <0 then DivideIt = a/b
End Function
and insert as the control source
=DivideIt([FieldValue],[FieldValue]}
Oct 17 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by M. Akkerman | last post: by
65 posts views Thread by Pmb | last post: by
4 posts views Thread by ferbar | last post: by
3 posts views Thread by gh | last post: by
11 posts views Thread by Martin Höfling | last post: by
4 posts views Thread by Harish Ramadurgam | last post: by
reply views Thread by kamranasdasdas | last post: by
reply views Thread by gcreed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.