replaced Divided by zero message with the 100%

Hello,
I'm calculating the difference in a number of cases between various years like in the screenshot, but when for a particular year there is 0 cases, i get Divided by zero message.
Here is the example of the formula: =([2022]@row - [2021]@row) / [2021]@row.
I'm just replacing the years depending on which year I need to compare.
are.
I understand why this error mathematically, but can i replace the error message with "100%" to show an increase or "0" if both years have 0 in them and apply this formula to all the years even if the cases are not 0 - to keep the formula unified?
thank you
Best Answer
-
You would use an IFERROR function.
=IFERROR(original formula, output when original formula errors)
Answers
-
You would use an IFERROR function.
=IFERROR(original formula, output when original formula errors)
-
thank you, @Paul Newcome !
Help Article Resources
Categories
Check out the Formula Handbook template!