#Incorrect argument due to #Divide by zero
I have been attempting to create a formula where I will not have to manually update this every month. My "OSHA Loss Time Rate" is broke down by month (JanDec rows), the 7.78 formula is "=(([Lost Time Cases]@row * 200000) / [Hours Worked]@row)", however if I do not have any hours in or a 0, it shows the #DIVIDE BY ZERO, due to nothing there. I have seen numerous posts talking about the IFERROR formula, however I have no idea how to use it. Since I have the hours in for January (first line with 7.78) but none for February, I am assuming I need to add the IFERROR option included in the formula for the OSHA Loss Time Rate? If so, how would you do that formula?
The other issue is that the top grey #INCORRECT ARGUMENT is due to needing to get the average of all the months (JanDec) below that line. Once again, I am assuming I need to add in the IFERROR formula due it trying to calculate the average but there is an error (#DBZ).
Thank you,
Mitchell Reynolds
Best Answer

The IFERROR wraps around the existing formula to output something different in the event the original formula throws an error.
=IFERROR(original_formula, "output if error")
=IFERROR((([Lost Time Cases]@row * 200000) / [Hours Worked]@row), "output if error")
Answers

I haven't read what you have to say, only the title and the screenshot.
In the cell with #DIVIDE BY ZERO, use an IFERROR i.e. =IFERROR([your formula here],"")
That should sort it out.

The IFERROR wraps around the existing formula to output something different in the event the original formula throws an error.
=IFERROR(original_formula, "output if error")
=IFERROR((([Lost Time Cases]@row * 200000) / [Hours Worked]@row), "output if error")

Thank you! Trying to read the formula information on Smartsheet just confused me even more. This was a very simple explanation for me, and it worked perfect!
Thank you,
Mitchell Reynolds

Happy to help. 👍️
Help Article Resources
Categories
 All Categories
 14 Welcome to the Community
 Smartsheet Customer Resources
 62.3K Get Help
 364 Global Discussions
 199 Industry Talk
 428 Announcements
 4.4K Ideas & Feature Requests
 136 Brandfolder
 127 Just for fun
 128 Community Job Board
 444 Show & Tell
 28 Member Spotlight
 1 SmartStories
 283 Events
 35 Webinars
 7.3K Forum Archives
Check out the Formula Handbook template!