The fastest fix is to wrap the formula in IF: =IF(A2="","",A2-B2) shows a blank instead of a zero when the source cell is empty. If the zero is a real calculated result you want hidden, apply a custom number format of 0;-0;;@ instead, which hides zeros without deleting them. Which of the two you need depends on whether the 0 is an unwanted default or a value you genuinely want to keep but not display.
Excel returns 0 rather than an error when it does arithmetic on an empty cell, because a blank cell is treated as zero in calculations. Copying a subtraction or lookup formula down a column therefore leaves a trail of 0s in rows that are not yet filled in. Removing those 0s makes reports readable and stops charts from drawing lines back to zero at the bottom of empty tail rows.
A note before you start: menu names and dialog wording vary slightly by Excel version, platform and language pack, so if a label does not match exactly, look for the nearest equivalent.
What You'll Need
- A working copy of the workbook you can edit — save a copy first if the file is shared or important.
- Access to the formula cells or the range you want to clean up.
- Some idea of whether the 0 is a default from empty cells (fix with IF) or a legitimate result (fix with formatting).
- Optional: the Formulas tab visible on the ribbon, which makes auditing easier.
Step-by-Step
- Decide which kind of zero you have. Click a cell showing 0 and look at the formula bar. If the formula references an empty cell — for example
=A2-B2where B2 is blank — the 0 is a default result. If both cells contain real values and the result genuinely is zero, formatting is the right fix. - Wrap the calculation in IF for the blank-cell case. Change
=A2-B2to=IF(A2="","",A2-B2). This checks whether the input is empty and returns an empty string instead of running the subtraction. For a two-input formula, test the more important cell, usually the first one people fill in. - Use COUNT or COUNTA for multi-cell checks. If the formula depends on several cells,
=IF(COUNT(A2:C2)=0,"",A2-B2)returns blank only when all the inputs are empty. COUNTA instead of COUNT lets that same test work on text as well as numbers. - Use IFERROR for lookups and division. A VLOOKUP or XLOOKUP that finds nothing returns #N/A, but a lookup that finds an empty cell can return 0. Wrap it:
=IFERROR(XLOOKUP(D2,A2:A100,B2:B100),""). For divisions where a zero divisor is possible,=IF(B2=0,"",A2/B2)avoids the error and the zero in one step. - Copy the corrected formula down the column. Select the cell, grab the fill handle at its bottom-right corner and drag, or double-click the fill handle to fill to the end of the adjacent data. Paste it over the original formulas, then check a few rows at the bottom where the data runs out.
- Switch to number formatting for genuine zeros. Select the range, press Ctrl+1 (Cmd+1 on Mac) to open Format Cells, go to the Number tab and choose Custom. Enter
0;-0;;@in the Type box and click OK. This hides zeros while the underlying values stay in place and keep working in sums and formulas. - Or use Excel's built-in option for an entire sheet. Go to File > Options > Advanced, scroll to the section for this worksheet and clear the tick beside "Show a zero in cells that have zero value". This hides every zero on that sheet at once, which is ideal for a print or PDF copy.
- Or tick the global display setting in newer builds. On recent Excel versions the same toggle also appears in the display settings inside the settings area of the worksheet. Either route affects display only, so totals are unchanged.
- Consider conditional formatting for a visual hide. Select the range, go to Home > Conditional Formatting > New Rule > Format only cells that contain, set the rule to Cell Value equal to 0, and set the font colour to match the cell fill (usually white). This keeps the cell editable and the value present while making it invisible.
- Verify your totals. After any change, add a quick SUM over the affected column and compare it with a copy taken before the edit. Blank strings are ignored by SUM, but text returned by IF can trip up formulas that expect numbers, so confirm the results still add up.
Common Mistakes
- Hiding the zero instead of fixing it. Display settings and custom formats only change appearance. If a downstream formula counts blanks or relies on ISBLANK, the cell still contains 0 and will behave unexpectedly. For dependency-sensitive sheets, use the IF approach.
- Returning "" inside an arithmetic chain. An empty string looks blank but is text, so a later formula doing
SUM(range)is fine while one doingrange*1or passing it to a function that needs a number can fail. Test the downstream steps after the change. - Testing the wrong cell. Writing
=IF(B2="","",A2-B2)when A2 is the first cell filled leaves the 0 in place until B2 is entered. Test the cell that is populated first in real use. - Letting the fill handle break references. Dragging a formula without the right relative and absolute references (the
$signs) gives wrong results lower down; always check the last row. - Assuming a custom format hides errors too. The format
0;-0;;@hides zeros only. Errors such as #DIV/0! still show and need IFERROR or an IF test. - Forgetting charts and pivot tables. A chart plotting blank strings can still dip to zero if the axis is set to show it; a pivot table needs its own option for showing items with no data.
Tips
- Combine both approaches: wrap the formula in IF to avoid default zeros, then apply the custom format for any genuine zeros you want hidden in a printed report.
- Apply the Format Cells change to whole columns rather than individual cells so new rows inherit it.
- Use the Evaluate Formula tool on the Formulas tab to see exactly why a cell returns 0 — it steps through the calculation one part at a time.
- If you only want zeros gone in a PDF or printout, the per-worksheet option under File > Options > Advanced is the quickest route and is easily reversed.
- Keep a backup before bulk-editing formulas. Replacing a whole column of working formulas is easy to do and harder to undo cleanly.
- For text joins such as
=A2&" "&B2, the zero problem does not arise, but leading empty strings can leave stray spaces — trim the result with TRIM if needed.
Troubleshooting
- The cell still shows 0 after wrapping in IF. The 0 is probably a real calculated value, not a default. Confirm by clicking the cell and reading the formula bar, then use the custom format or the show-zero option.
- The formula returns an error after the change. A downstream formula is trying to do maths on an empty string. Either point it at a blank-aware test or return 0 and hide it with formatting instead.
- The custom format does nothing. Check you applied it to the right range and that the cells do not have a conflicting format from a table style. Reopen Format Cells and confirm the Type box still shows
0;-0;;@. - Zeros disappear everywhere when you wanted one column only. You most likely changed the whole-worksheet option. Undo it by re-ticking the box under File > Options > Advanced.
- Charts still show a line at zero. Blank strings plotted as values can still read as zero on some chart types. Change the chart to treat blanks as gaps in the chart settings or format the axis so zero is not shown.
- Collaborators still see zeros. Display options are often saved per user or per window, so the setting may not travel with the file. Use IF or a custom format if the appearance must be consistent for everyone.
Frequently Asked Questions
Why does Excel show 0 instead of nothing?
Because blank cells count as zero in arithmetic. Subtracting an empty cell from a number gives zero, and Excel displays that result rather than leaving the cell empty.
Does the custom number format change the actual value?
No. The value stays in the cell and still counts in sums. Only the display is hidden, so printing and copying give the same totals.
Can I hide zeros without changing the formula?
Yes. Use a custom number format of 0;-0;;@, or clear the show-zero option for the worksheet under File > Options > Advanced.
Will IF(A2="","",...) break my totals?
SUM ignores returned empty strings, so column totals usually stay correct. Formulas that do direct arithmetic on the result can fail, so test those.
How do I hide only the zeros and not negative numbers?
Use the format 0;0;;@ if negatives should still show, or adjust the third section, which controls zero, to an empty value.
Does this work in Excel for the web and on mobile?
The IF formula works everywhere. Display and format options are reduced in the web and mobile apps; the full Format Cells dialog and the show-zero option are easiest to reach in Excel for desktop.