Unless you've spent years to become a master of the spreadsheets, there's a good chance you'll run into errors when trying something new in Excel. It's only natural - the software isn't great at teaching new users its tricks.
When trying to do sums, there's a good chance you'll run into errors. One of the most common yet confusing is #DIV/0, so read on - in this guide, we'll explain how to fix the #DIV/0 error in Excel.
How to fix the #DIV/0 error in Excel
The #DIV/0! error is one that appears when your division goes wrong. This could be for any number of reasons; the most common is users trying to divide by zero (hence the error's name being shorthanded for 'divided by 0'.) Two examples of dividing by zero have been listed below - if your sum looks like them, that's why you're getting this error.
If you are certain that you're not working with faulty math, check the sum - is it referencing the correct cells? The #DIV/0 error will also appear if you're trying to use a blank cell in your division.
In some spreadsheets (e.g sheets tracking sales figures), the #DIV/0 error may be unavoidable while a given value is at zero. To swap the error message out for a custom message, however, you'll want to add this code to the cell:
- =IFERROR(X, "MESSAGE")
- 'X' is the usual sum you'd have in the cell, like A15/B15 or similar
- "MESSAGE" is the value you'd like to display when the #DIV/0 error appears.
It's important to make sure the sum and message are separated by a comma, and that your message is surrounded by "quotation marks" or it won't work. The message is otherwise totally customisable, however, so you can make it as eye catching or subtle as you'd like.