← All how-to recipes

How to display zero as a dash

✓ Verified in LibreOffice 25.8.7.3

Show "-" instead of 0 in reports, accounting-style, without destroying the numbers.

The formula

AppFormulaNotes
Excel#,##0;-#,##0;"-"This is a custom NUMBER FORMAT (Ctrl+1 → Custom), not a formula — the cell still contains the real 0.
Google Sheets#,##0;-#,##0;"-"Format → Number → Custom number format. Identical syntax.
LibreOffice Calc#,##0;-#,##0;"-"Format → Cells → Number → Format code. Identical.

How it works

Number formats have up to three value sections separated by semicolons — positive;negative;zero — so putting "-" in the third slot swaps every zero's DISPLAY for a dash while the cell keeps its true value for sums and charts (the verification proves the format string via TEXT). This beats formula tricks like IF(A2=0,"-",A2), which turn numbers into text and quietly break downstream math. The built-in Accounting format uses exactly this mechanism.

Verified, not just documented

We ran =TEXT(0,"#,##0;-#,##0;""-""") in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned - — exactly the expected result. Every formula here is confirmed by actually executing it.