Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 246
  • Last Modified:

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
0
Rex85
Asked:
Rex85
  • 2
1 Solution
 
mbizupCommented:
iif(Total_QNs = 0 OR Total_Shipped = 0,0,  Total_QNs/Total_Shipped)
0
 
Rex85Author 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.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now