Can I Make a Calculated Field that Returns a Zero if the Calculation Would Result in an Error Due to a Zero in the Denominator?

I am trying to make a ratio of the Total_QNs/Total_Shipped....However, sometimes One or both of those fields is a zero, which returns an error. I would like it to return the ratio if there is data, or a zero if the denominator or numerator is a zero
RexQuality LeaderAsked:
Who is Participating?
 
mbizupCommented:
iif(Total_QNs = 0 OR Total_Shipped = 0,0,  Total_QNs/Total_Shipped)
0
 
RexQuality LeaderAuthor Commented:
Thank you!
0
 
mbizupCommented:
Glad to help out :)

In explanation the IIf function evaluates an expression to see if it is tru or false and then returns a value based on that determination.

IIf(someExpression, ReturnThisIfTrue, ReturnThisIfFalse)
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.