cancel
Showing results for 
Search instead for 
Did you mean: 

how to resolve #div/0

Former Member
0 Kudos

Hi EveryOne,

                   i got this error  while doing the (neumarator)/(denamarator)*100 how to resolve it.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

What I've typically done to resolve this type of error is embed a condition on the denominator to check for 0. If the denominator is 0, I use 1 otherwise I use the denominator value.

This of course is highly dependent on what you're trying to achieve though, so it might not make sense in your instance.

eg:

=[nominator]/ (If [denominator]=0 OR IsNull([denominator]) Then 1 Else [denominator])

Former Member
0 Kudos

There are different ways depending what you want to display.

If you have a field and it is trying to evalute 55/0, what does that mean in the context of that report?

If you are looking at, say, number of runs divided by number of errors to get average runs per error, is 55 correct? Is 0 correct? Neither are correct because you don't have an error in any of your 55 runs but how do you want to represent that in your report?

If you say 55 on the basis that there are no errors and you will accept 0 errors the same as 1 error then use =If([d]=0;[n];100*[n]/[d])

If you want it to be 0, use Ajay's suggestion but the overall answer is that it depends entirely on what you want it to be - use an If statement to detect the 0 and present what you want to present.

CdnConnection
Active Contributor
0 Kudos

Stefen,

   You need to create the following variable.

If ( [denamarator] = 0 ; 0 ; ([neumarator] / [denamarator]) * 100

Regards,

Ajay