How to show blank instead of zero with IF

A column that shows a blank when there is nothing to report, instead of a column full of zeros.

The formula

=IF(B2=0,"",B2) in column C

What each part does

B2=0
The test: is the value on this row zero?
""
An empty result, so the cell appears blank.
B2
The figure itself when there is one.

How it works, and what to watch for

The cell only looks empty. It holds an empty text value, which is different from truly blank, and anything counting blanks further down will still see something here.

That matters for COUNTBLANK and ISBLANK, which both say the cell is filled. If a later formula depends on blankness, this is worth knowing before relying on it.

To hide every zero on a sheet without a formula, turn off "Show a zero in cells that have zero value" in the Excel options. That changes only the display and leaves the values alone.

Questions

Why does my chart show a gap now?

Charts treat an empty text value as zero or as a gap depending on the setting. Using NA() instead of "" makes the chart skip the point cleanly.

Can I hide zeros with formatting instead?

Yes, a custom format of 0;-0;; shows positives and negatives and nothing for zero, keeping the value intact.

Will the column still add up?

Yes. SUM ignores text, so the empty results are simply skipped.

The example sheet

Item Qty Shown
Widget 0
Bolt 12
Gear 0
Clip 7

If this helped, these are close by

More on IF, and every walkthrough that uses it.

Settings: separator, Excel version

Argument separator

Set by your computer's language, not by the file. A frequent cause of a correct-looking formula being rejected.

Excel version

XLOOKUP, IFS, TEXTBEFORE and TEXTJOIN need Microsoft 365 or 2021; older versions return #NAME? instead. Choosing the older one switches every walkthrough to a formula that works there.