#Num! error in report

randolphoralph

Registered User.
Local time
Today, 15:17
Joined
Aug 4, 2008
Messages
101
I have created a report and used the following formula and the report is returning a #Num! error. I have read it is returning the error since it is tring to divide by 0. How would I change the formula to get it to return a 0 instead of a #Num! error?

Code:
=([SumOfTotal Points]/[SumOfTotal Possible Points])
 
You can try this:
Code:
=IIF([SumOfTotal Possible Points] <> 0,[SumOfTotal Points]/Nz([SumOfTotal Possible Points],1))

So this tells it if the divisor doesn't equal zero then use the function but also the NZ function checks to see if the field is not null and if null uses a 1 to divide by.
 
Thank you! That did remove the error, but when the result of the formula is 0 it is returning a blank value.

How would I get the formula to display a 0 instead of a blank?
 
Perhaps this:
Code:
=IIF([SumOfTotal Possible Points] <> 0,[SumOfTotal Points]/Nz([SumOfTotal Possible Points],1)[B][COLOR=red],0)[/COLOR][/B]
[B][COLOR=#ff0000][/COLOR][/B] 
[B][COLOR=#ff0000]
[/COLOR][/B]
 
SOS

I was able to find a solution by trying the following.

Code:
=IIF([SumOfTotal Possible Points] = 0,0,[SumOfTotal Points]/Nz([SumOfTotal Possible Points],1))

It appears to be working properly. Thank you for your help.
 

Users who are viewing this thread

Back
Top Bottom