Excel formula auditing: how to check a spreadsheet's formulas
Formula auditing means checking how a spreadsheet's answers are worked out, so you know whether to trust them. Excel's tools for it are on the Formulas tab, in the Formula Auditing group: Show Formulas, Trace Precedents, Trace Dependents, Remove Arrows, Error Checking, Evaluate Formula and the Watch Window. Excel for Mac has the same buttons on its Formulas tab.
Each tool answers one question about a sheet. Which cells hold a typed number where a formula should be? Which cells does this total use? What will change if I edit this rate? Where does this formula go wrong? This guide takes each one in turn on a small sheet, then puts them together into a routine for checking a workbook someone has handed you.
The formula auditing tools at a glance
| The question | The tool | What you see |
|---|---|---|
| Is anything typed over a formula? | Show Formulas | Every cell shows its formula instead of its answer |
| Which cells does this formula use? | Trace Precedents | Blue arrows, and a box round each range, pointing into the cell |
| Which formulas use this cell? | Trace Dependents | Arrows from the cell to every formula that uses it |
| Where does a long formula go wrong? | Evaluate Formula | The formula worked out one step at a time |
| Does anything look like a mistake? | Error Checking | Green triangles, and a ⚠ button that says what Excel found |
| How does a total change as I edit? | Watch Window | A box that keeps chosen cells in view, wherever you are |
In Excel for Windows they're all at Formulas › Formula Auditing. In Excel for Mac they're on the Formulas tab too, though the group has no name on it. Each one is worked through below.
Show Formulas: spot a number typed over a formula
A shop sheet has quarterly sales for five shops, a total for each shop in column F, and totals for each quarter in row 7. Everything looks fine until you add it up two ways. The quarter totals come to £8,800 + £8,600 + £9,200 + £10,200 = £36,800. The shop totals in F7 come to £36,200. Something is £600 out.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Shop | Q1 | Q2 | Q3 | Q4 | Total |
| 2 | Leeds | £2,100.00 | £1,900.00 | £2,300.00 | £2,500.00 | £8,800.00 |
| 3 | York | £1,800.00 | £1,700.00 | £2,000.00 | £2,200.00 | £7,700.00 |
| 4 | Hull | £1,500.00 | £1,600.00 | £1,400.00 | £1,700.00 | £6,200.00 |
| 5 | Bath | £2,200.00 | £2,100.00 | £2,400.00 | £2,300.00 | £8,400.00 |
| 6 | Ely | £1,200.00 | £1,300.00 | £1,100.00 | £1,500.00 | £5,100.00 |
| 7 | Total | £8,800.00 | £8,600.00 | £9,200.00 | £10,200.00 | £36,200.00 |
Press Ctrl+` (the key above Tab; it's Control+` on a Mac) or click Formulas › Show Formulas. Every cell now shows what's in it rather than its answer:
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Shop | Q1 | Q2 | Q3 | Q4 | Total |
| 2 | Leeds | 2100 | 1900 | 2300 | 2500 | =SUM(B2:E2) |
| 3 | York | 1800 | 1700 | 2000 | 2200 | =SUM(B3:E3) |
| 4 | Hull | 1500 | 1600 | 1400 | 1700 | =SUM(B4:E4) |
| 5 | Bath | 2200 | 2100 | 2400 | 2300 | 8400 |
| 6 | Ely | 1200 | 1300 | 1100 | 1500 | =SUM(B6:E6) |
| 7 | Total | =SUM(B2:B6) | =SUM(C2:C6) | =SUM(D2:D6) | =SUM(E2:E6) | =SUM(F2:F6) |
F5 holds the number 8400. Someone typed it over the formula, and Bath's sales have changed since: they now add up to £2,200 + £2,100 + £2,400 + £2,300 = £9,000. That's the missing £600. Copy the formula down from Hull's total to put it back, and press the same keys again to see the answers. Show Formulas changes nothing on the sheet; it only changes what you see.
Trace Precedents: which cells does this formula use?
An overtime sheet has eight weeks of hours in B2:B9, and the total in B10 says 39 hours. Add them up yourself: 6 + 4 + 7 + 5 + 8 + 3 + 6 + 9 = 48. Click B10, then Formulas › Trace Precedents.
| A | B | |
|---|---|---|
| 1 | Week | Overtime (hours) |
| 2 | Week 1 | 6 |
| 3 | Week 2 | 4 |
| 4 | Week 3 | 7 |
| 5 | Week 4 | 5 |
| 6 | Week 5 | 8 |
| 7 | Week 6 | 3 |
| 8 | Week 7 | 6 |
| 9 | Week 8 | 9 |
| 10 | Total | 39 |
A blue box goes round B2:B8, with an arrow to B10. The box stops a row short, so the 9 hours in week 8 aren't counted. This happens when a row is added under a total's range. Change B10 to =SUM(B2:B9) and it says 48. (Make the list an Excel table and a total like this keeps up with new rows by itself.)
Some things the arrows tell you:
- A single cell gets a dot and an arrow; a range gets a box.
- Click Trace Precedents again to go a level further back: if the total adds other totals, arrows now come from the cells they use.
- A red arrow comes from a cell that shows an error. Follow the red arrows back to find where an error such as #DIV/0! starts.
- A dashed black arrow to a little sheet icon means the formula uses another worksheet. Double-click the dashed line to see which cells.
Trace Dependents: what will change if I edit this cell?
Before you change the VAT rate in B1, check what it feeds. Click B1, then Formulas › Trace Dependents. An arrow goes from B1 to every formula that uses it.
| A | B | C | |
|---|---|---|---|
| 1 | VAT rate | 20% | |
| 2 | Item | Price | VAT |
| 3 | Printer paper | £45.00 | £9.00 |
| 4 | Toner | £120.00 | £24.00 |
| 5 | Children's books | £60.00 | £0.00 |
| 6 | Desk lamp | £35.00 | £7.00 |
| 7 | Kettle | £30.00 | £6.00 |
| 8 | Total | £290.00 | £46.00 |
Four arrows, to C3, C4, C6 and C7. Children's books have no VAT, so C5 holds a typed 0 and gets no arrow. Click Trace Dependents again and the arrows carry on to the total in C8, which adds those four. Change the rate to 0.25 and you know exactly which cells move: £45 × 0.25 = £11.25 for printer paper, and so on.
It's worth doing before you delete a cell or a column too: if anything uses it, those formulas turn into #REF! errors.
The arrows stay until you take them off. Remove Arrows, next to the trace buttons, clears them all. Its ▾ has Remove Precedent Arrows and Remove Dependent Arrows, which take off one level at a time.
Evaluate Formula: watch a formula work, one step at a time
A tracker shows whether each pupil reached their target over two terms. Bea's line says Not met, and her teacher wants to know why. Click E3, then Formulas › Evaluate Formula. The box shows the formula with the next part to be worked out underlined. Each click of Evaluate works out that part.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Name | Term 1 | Term 2 | Target | Result |
| 2 | Ali | 41 | 36 | 70 | Met |
| 3 | Bea | 38 | 29 | 70 | Not met |
| 4 | Cy | 35 | 35 | 70 | Met |
| 5 | Dev | 30 | 44 | 80 | Not met |
| Click | What the box shows |
|---|---|
| Start | IF(B3+C3>=D3,"Met","Not met") |
| Evaluate | IF(38+C3>=D3,"Met","Not met") |
| Evaluate | IF(38+29>=D3,"Met","Not met") |
| Evaluate | IF(67>=D3,"Met","Not met") |
| Evaluate | IF(67>=70,"Met","Not met") |
| Evaluate | IF(FALSE,"Met","Not met") |
| Evaluate | "Not met" |
So the formula is right: 67 is under 70. If you expected Met, the step where it went the other way shows you which number to check. Cy is the one to look at closely: 35 + 35 = 70 exactly, and >= counts that as met. Write > by mistake and Cy would get Not met, which Evaluate Formula would show as 70>70 giving FALSE.
Step In opens up a cell the formula uses, if that cell holds a formula of its own, so you can follow it back. Step Out comes back. It's the quickest way to find which part of a long formula gives an error such as #VALUE!.
Error checking: the green triangles
Excel checks the sheet as you work and puts a small green triangle in the top-left corner of any cell that looks wrong. Click the cell and a ⚠ button appears beside it; hover over it to see what Excel found, or click it for the fixes. In this order sheet, D5 has a triangle:
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Item | Qty | Price | Total |
| 2 | A4 paper | 4 | £3.50 | £14.00 |
| 3 | Pens | 10 | £1.20 | £12.00 |
| 4 | Folders | 6 | £2.50 | £15.00 |
| 5 | Staples | 3 | £1.80 | £15.00 |
| 6 | Labels | 5 | £4.00 | £20.00 |
The ⚠ says Inconsistent Formula: the formulas around D5 each use their own row, and D5 uses the row above. Staples should be 3 × £1.80 = £5.40, but D5 says £15.00, the folders total. Choose Copy Formula from Above and it's fixed.
The other things Excel flags most often:
- Number stored as text: a number sitting on the left of the cell, which SUM skips. See formula not calculating.
- Formula omits adjacent cells: a total that stops just short of more numbers, like the overtime total above.
- Formula refers to empty cells: off until you turn it on, but useful on a sheet that should have no gaps.
If the cell is right, choose Ignore Error and the triangle goes. To check the whole sheet one flagged cell at a time, click Formulas › Error Checking. To choose which checks Excel makes: on Windows, File › Options › Formulas, under Error checking rules; on a Mac, the Excel menu › Preferences › Error Checking.
The Watch Window: keep a total in view
On a big sheet, the total you care about is often off the screen while you change the numbers that feed it. Click the total, then Formulas › Watch Window and Add Watch. A small box shows the cell's sheet, address, value and formula, and stays on top while you scroll or move to another sheet. Change a sales figure 200 rows up and you see the grand total move straight away. Add as many cells as you like; select one in the box and click Delete Watch to take it off. It works the same way in Excel for Mac.
A routine for checking a spreadsheet
When someone hands you a workbook and asks if the numbers are right, these steps, in this order, find most mistakes in a few minutes:
- Show Formulas and scan each column. A column of formulas with one plain number in it is the classic slip, as in F5 above.
- Add it up two ways. Row totals and column totals should meet in the corner. If they don't, the difference tells you how much to look for.
- Trace Precedents on every total. Check the box covers every row, and no more.
- Click each green triangle and read what Excel found before you ignore it.
- Trace Dependents on the inputs, such as rates and targets, before you change them.
- Evaluate Formula on anything long or surprising, and on one row you've worked out by hand.
Fixed numbers inside formulas are worth a look too: =B2*1.2 hides a VAT rate that should be in its own cell, with an absolute reference to it.
Practise it
This lesson has Excel's Formula Auditing buttons above a practice sheet (Trace Precedents and Dependents, Error Checking, Evaluate Formula and the Watch Window), with arrows and green triangles drawn as in Excel, and each task is checked as you go.
Open the Showing formulas and tracing where numbers come from lesson
Part of Excel formula auditing practice: every lesson on the topic, with a project in Excel.
The lesson is free and runs in your browser with Excel's Formula Auditing buttons: Show Formulas, Trace Precedents and Dependents, and Remove Arrows, with arrows drawn as in Excel. The next lesson, Watch Window, Evaluate Formula and error checking, covers the rest. Both cover the formula auditing tasks in the MO-211 Excel Expert exam.
Questions
What is formula auditing in Excel?
Formula auditing is checking how a spreadsheet works its answers out, so you can trust them. Excel has a group of tools for it on the Formulas tab: Show Formulas, Trace Precedents, Trace Dependents, Remove Arrows, Error Checking, Evaluate Formula and the Watch Window. They show which cells each formula uses, which formulas use each cell, and where a formula goes wrong, without changing anything on the sheet.
What is the difference between precedents and dependents in Excel?
Precedents are the cells a formula uses. If D2 holds =B2*C2, then B2 and C2 are its precedents. Dependents go the other way: they are the formulas that use a cell, so D2 is a dependent of B2. Trace Precedents draws arrows into the cell you picked, and Trace Dependents draws arrows out of it. Remove Arrows clears both.
Where are the formula auditing tools in Excel for Mac?
On the Formulas tab, as in Excel for Windows: Trace Precedents, Trace Dependents, Remove Arrows, Show Formulas, Error Checking, Evaluate Formula and the Watch Window. The group has no name on a Mac. The Show Formulas keys are Control and the key with the backtick. The error checking rules are under the Excel menu, then Preferences, then Error Checking.
Why can't I see the trace arrows in Excel?
The usual reason is that objects are hidden. Excel draws the arrows as objects, so if a workbook is set to hide them, nothing appears. On Windows, go to File, Options, Advanced and under display options for this workbook choose All for objects. Arrows also disappear when you change a cell they start or end at, and they don't show on a protected sheet.