1.
Formula Errors
This chapter teaches you how to deal with some common formula
errors in Excel.
##### error
When your cell contains this error code, the column isn't wide enough to
display the value.
img1
1. Click on the right border of the column A header and increase the
column width.
img2
Tip: double click the right border of the column A header to automatically fit
the widest cell in column A.
#NAME? error
The #NAME? error occurs when Excel does not recognize text in a formula.
img3
1. Simply correct SU to SUM.
img4
#VALUE! error
Excel displays the #VALUE! error when a formula has the wrong type of
argument.
img5
1a. Change the value of cell A3 to a number.
1b. Use a function to ignore cells that contain text.
img6
#DIV/0! error
Excel displays the #DIV/0! error when a formula tries to divide a number by
0 or an empty cell.
img7
1a. Change the value of cell A2 to a value that is not equal to 0.
1b. Prevent the error from being displayed by using the logical function IF.
img8
Explanation: if cell A2 equals 0, an empty string is displayed. If not, the
result of the formula A1/A2 is displayed.
#REF! error
Excel displays the #REF! error when a formula refers to a cell that is not
valid.
1. Cell C1 references cell A1 and cell B1.
img9
2. Delete column B. To achieve this, right click the column B header and
click Delete.
img10
3. Select cell B1. The reference to cell B1 is not valid anymore.
img11
4. To fix this error, you can either delete +#REF! in the formula of cell B1 or
you can undo your action by clicking Undo in the Quick Access Toolbar (or
press CTRL + z).
img12
2. IfError
This example illustrates the IFERROR function in Excel.
1. For example, Excel displays the #DIV/0! error when a formula tries to
divide a number by 0.
img13
2. Use the IFERROR function. If a cell contains an error, an empty string
("") is displayed.
img14
3. IsError
This example illustrates the ISERROR functionin Excel.
1. For example, Excel displays the #DIV/0! error when a formula tries to
divide a number by 0.
img15
The ISERROR function checks whether a value is an error and returns
TRUE or FALSE.
2. Use the IF and the ISERROR function. If a cell contains an error, the
value 5 is returned. If not, the value 100 is returned.
img16
4. Circular Reference
A formula in a cell that directly or indirectly refers to its own cell is called
a circular reference. This is not possible.
1. For example, the formula in cell A3 below directly refers to its own cell.
This is not possible.
img17
Note: Excel returns a 0 if you accept this circular reference.
2a. For example, the formula in cell C2 below refers to cell C1.
img18
2b. The formula in cell C3 refers to cell C2.
img19
2c. The formula in cell C4 refers to cell C3.
img20
2d. So far, everything's OK. Now change the value in cell C1 to the formula
=C4. Cell C1 refers to cell C4, cell C4 refers to cell C3, cell C3 refers to cell
C2, and cell C2 refers to cell C1. In other words, the formula in cell C1
indirectly refers to its own cell. This is not possible.
img21
Note: Excel returns a 0 if you accept this circular reference.
3. To find your circular references, on the Formulas tab, click the down
arrow next to Error Checking, and click Circular References.
img22
5. Formula Auditing
Trace Precedents | Remove Arrows | Trace Dependents | Show Formulas |
Error Checking | Evaluate Formula
Formula auditing in Excel allows you to display the relationship between
formulas and cells. The example below helps you master Formula
Auditing quickly and easily.
img23
Trace Precedents
You have to pay $96.00. To show arrows that indicate which cells are used
to calculate this value, execute the following steps.
1. Select cell C13.
2. On the Formulas tab, in the Formula Auditing group, click Trace
Precedents.
img24
Result:
img25
As expected, Total cost and Group size are used to calculate the Cost per
person.
3. Click Trace Precedents again.
img26
As expected, the different costs are used to calculate the Total cost.
Remove Arrows
To remove the arrows, execute the following steps.
1. On the Formulas tab, in the Formula Auditing group, click Remove
Arrows.
img27
Trace Dependents
To show arrows that indicate which cells depend on a selected cell,
execute the following steps.
1. Select cell C12.
2. On the Formulas tab, in the Formula Auditing group, click Trace
Dependents.
img28
Result:
img29
As expected, the Cost per person depends on the Group size.
Show Formulas
By default, Excel shows the results of formulas. To show the formulas
instead of their results, execute the following steps.
1. On the Formulas tab, in the Formula Auditing group, click Show
Formulas.
img30
Result:
img31
Note: instead of clicking Show Formulas, you can also press CTRL + (`).
You can find this key above the tab key.
Error Checking
To check for common errors that occur in formulas, execute the following
steps.
1. Enter the value 0 into cell C12.
img32
2. On the Formulas tab, in the Formula Auditing group, click Error
Checking.
img33
Result. Excel finds an error in cell C13. The formula tries to divide a
number by 0.
img34
Evaluate Formula
To debug a formula by evaluating each part of the formula individually,
execute the following steps.
1. Select cell C13.
2. On the Formulas tab, in the Formula Auditing group, click Evaluate
Formula.
img35
3. Click Evaluate four times.
img36
Excel shows the formula result.
img37
6. Floating Point Errors
Excel stores and calculates floating point numbers. Sometimes, the result
of a formula is a very close approximation.
1. For example, take a look at the formulas below. At first glance,
everything looks alright.
img38
2. However, if we show 16 decimal places, we can see that one result is a
very close approximation.
img39
You don't have to worry about floating point errors. They are rare. Even if
your worksheet contains a floating point error, in most cases, this causes
no problems.
3. However, if you compare the value in cell C8 with another value, this can
happen.
img40
4. Use the ROUND function to fix this.
img41