When working with numerical data in Excel, it's common to encounter cells that contain zeros. However, there are situations where displaying zeros might not be desirable, especially when dealing with missing or empty data. In such cases, showing a dash instead of zero can be a more visually appealing and meaningful representation of the data.
In this article, we will explore five ways to show a dash instead of zero in Excel, each with its own unique approach and application.
Understanding the Importance of Displaying Dashes Instead of Zeros
Before diving into the methods, it's essential to understand why displaying dashes instead of zeros is useful. Here are a few reasons:
- Improved Readability: Dashes can make your data more readable, especially when working with large datasets or financial reports. A dash can indicate that a value is missing or not applicable, making it easier to distinguish between zeros and missing data.
- Enhanced Visual Appeal: Dashes can add a touch of professionalism to your reports and dashboards. By replacing zeros with dashes, you can create a more visually appealing and engaging presentation of your data.
- Better Data Interpretation: In some cases, displaying dashes instead of zeros can help with data interpretation. For example, in a financial report, a dash might indicate that a particular expense or revenue is not applicable, whereas a zero might suggest that the value is actual.
Method 1: Using Custom Number Formatting
One of the simplest ways to display a dash instead of zero in Excel is by using custom number formatting. Here's how:

- Select the cells that contain zeros you want to replace with dashes.
- Right-click on the selected cells and choose "Format Cells."
- In the Format Cells dialog box, click on the "Number" tab.
- Select "Custom" from the Category list.
- In the Type field, enter the following code:
#,##0;-#,##0;""
(without quotes). - Click "OK" to apply the changes.
The custom number formatting code #,##0;-#,##0;""
will display a dash instead of zero for cells that contain no value or are blank.
Method 2: Using Conditional Formatting
Another way to display a dash instead of zero in Excel is by using conditional formatting. Here's how:

- Select the cells that contain zeros you want to replace with dashes.
- Go to the "Home" tab in the Excel ribbon.
- Click on "Conditional Formatting" in the "Styles" group.
- Choose "New Rule" from the drop-down menu.
- Select "Use a formula to determine which cells to format."
- Enter the following formula:
=A1=0
(assuming the cell you want to format is in column A). - Click on the "Format" button and select a font style that displays a dash.
- Click "OK" to apply the changes.
The conditional formatting rule will apply the specified font style to cells that contain zero, effectively displaying a dash instead.
Method 3: Using IF Function
You can also use the IF function to display a dash instead of zero in Excel. Here's how:

- Select the cell where you want to display the result.
- Enter the following formula:
=IF(A1=0,"-",A1)
(assuming the cell you want to format is in column A). - Press Enter to apply the formula.
The IF function will check if the value in cell A1 is zero. If true, it will display a dash; otherwise, it will display the actual value.
Method 4: Using Replace Function
Another way to display a dash instead of zero in Excel is by using the REPLACE function. Here's how:

- Select the cell where you want to display the result.
- Enter the following formula:
=REPLACE(A1,0,"-")
(assuming the cell you want to format is in column A). - Press Enter to apply the formula.
The REPLACE function will replace all occurrences of zero in the selected cell with a dash.
Method 5: Using VBA Macro
Finally, you can use a VBA macro to display a dash instead of zero in Excel. Here's how:

- Press Alt + F11 to open the Visual Basic Editor.
- In the Editor, go to "Insert" > "Module" to insert a new module.
- Paste the following code:
Sub DisplayDashInsteadOfZero()
Range("A1").Select
Selection.Replace What:="0", Replacement:="-", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False, FormulaVersion:=xlReplaceFormula2
End Sub
- Save the macro by clicking "File" > "Save" (or press Ctrl + S).
- Close the Visual Basic Editor.
- Select the cell where you want to display the result.
- Press Alt + F8 to run the macro.
The VBA macro will replace all occurrences of zero in the selected cell with a dash.
Gallery of Displaying Dash Instead of Zero
Displaying Dash Instead of Zero in Excel









Final Thoughts
Displaying a dash instead of zero in Excel can be a useful formatting technique to improve readability and visual appeal. Whether you use custom number formatting, conditional formatting, IF function, REPLACE function, or VBA macro, there are several ways to achieve this formatting goal. By applying these methods, you can create more effective and engaging reports, dashboards, and presentations.