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 !
-
Happy to help. 👍️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 66K Get Help
- 429 Global Discussions
- 149 Industry Talk
- 488 Announcements
- 5.2K Ideas & Feature Requests
- 85 Brandfolder
- 152 Just for fun
- 74 Community Job Board
- 499 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 305 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!