zero divided by zero = #Num!

Cowboy_BeBa

Registered User.
Local time
Tomorrow, 01:40
Joined
Nov 30, 2010
Messages
188
Hi Everyone

got a small problem, i have a query/report that has quite a few fields, as its a summary page it has alot of calculated fields as well. One of these fields is Absolute % Varience (the formula for which is based on two fields, oldQTY and newQTY, formula is: ((newQTY-oldQTY)/oldQTY) * 100)

sometimes oldQTY and newQTY are both equal to zero, in this event i get #Num! as an answer, is there any way i can use something (similar to =nz() ) to make this field a zero instead (tried =nz, however that did not work)
 
Code:
Iif(oldQTY = 0, 0, (newQTY-oldQTY)/oldQTY) * 100)
 
Thanks Galaxiom! Dunno why i didnt think of that
cheers
 

Users who are viewing this thread

Back
Top Bottom