Formula to Return Blank Cell instead of Zero in Excel (with 5 Alternatives)

The easiest way to to return a blank cell instead of zero in Excel is to use a formula. In this article we’ll demonstrate and explain that formula, and provide 5 alternative methods.


Formula to Return Blank Cell instead of Zero: Combination of IF and VLOOKUP Functions

The following dataset contains some salespersons’ sales in two consecutive years. There are zero sales in some cells. We’ll use the IF and VLOOKUP functions in a formula to display blank cells in those cells instead.

Steps:

  • Enter the following formula in Cell D14:
=IF(VLOOKUP(B14,B5:D11,3,0)=0,"",VLOOKUP(B14,B5:D11,3,0))
  • Press Enter.

The formula returns blank cells for the zero sales of Oliver.

Formula to Return Blank Cell instead of Zero in Excel: Combination of IF and VLOOKUP Functions

Read More: How to Set Cell to Blank in Formula in Excel 


Alternative Methods 

Method 1 – Automatically Hide Zero

Excel has an built in feature that will convert all the zeros to blank cells automatically.

Steps:

  • Click File beside the Home tab.

Automatically Hide Zero to Return Blank Cell in Excel

  • Click Options from the bottom section, and a dialog box will open up.

Automatically Hide Zero to Return Blank Cell in Excel

  • Click the Advanced option.
  • Select the sheet from the drop-down of Display options for this worksheet section.

Automatically Hide Zero to Return Blank Cell in Excel

  • Just unmark the Show a zero in cells that have zero value option.
  • Click OK.

Blank cells will appear where all the zeros were before.

Read More: How to Make Empty Cells Blank in Excel


Method 2 – Using Conditional Formatting

Steps:

  • Select the data range C5:D11.
  • Click as follows: Home > Conditional Formatting > Highlight Cells Rules > Equal To.

Use Conditional Formatting to Return Blank Cell instead of Zero in Excel

  • Enter zero in the Format cells that are EQUAL TO box.
  • Select Custom Format from the dropdown list.

A Format Cells dialog box will open up.

Use Conditional Formatting to Return Blank Cell instead of Zero in Excel

  • Click the Font option.
  • Choose the white color from the Color section.
  • Click OK.

Use Conditional Formatting to Return Blank Cell instead of Zero in Excel

  • Alternatively, click Number > Custom and type three semicolons (;;;) in the Type box.
  • Click OK and it will return to the previous dialog box.

Use Conditional Formatting to Return Blank Cell instead of Zero in Excel

  • Just click OK.

All the zero values are returned as blank cells.


Method 3 – Apply Custom Formatting

Steps:

  • Select the data range.
  • Right-click your mouse and select Format Cells from the Context menu.

Apply Custom Formatting to Return Blank Cell instead of Zero

  • From the Number section click Custom.
  • Enter 0;-0;;@ in the Type box.
  • Click OK.

Apply Custom Formatting to Return Blank Cell instead of Zero

Blank cells now appear where the zeros were.


Method 4 – Using Pivot Tables

Steps:

  • Select the whole dataset.
  • Click Insert > Pivot Table.

Hide Zeros in Excel Pivot Tables to Return Blank Cell

  • Select your desired worksheet and click OK (here, New Worksheet).

Hide Zeros in Excel Pivot Tables to Return Blank Cell

  • Select the data range from the Pivot Table.
  • Click as follows: Home > Conditional Formatting > Highlight Cells Rules > Equal To.

Hide Zeros in Excel Pivot Tables to Return Blank Cell

  • Enter 0 (a zero) in the Format cells that are EQUAL TO box.
  • Select Custom Format from the dropdown list.

A Format Cells dialog box will open up.

Hide Zeros in Excel Pivot Tables to Return Blank Cell

  • From the Number section click Custom.
  • Enter ;;; in the Type box and press OK.

And we are done.


Method 5 – Using Find and Replace

Steps:

  • Select the data range C5:D11.
  • Press Ctrl+H to open the Find and Replace dialog box.
  • Enter 0 (a zero) in the Find what box and keep the Replace with box empty.

Find and Remove Zeros to Return Blank Cell in Excel

All the zeros are replaced with blank cells.

Find and Remove Zeros to Return Blank Cell in Excel


Replace Zeros with Dash or Specific Text

It’s as simple to replace zeros with a dash or specific text instead of blank cells.

Steps:

  • Select the range of data.
  • Right-click your mouse and select Format Cells from the Context menu.

Replace Zeros with Dash or Specific Text

  • From the Number section click Custom.
  • Enter 0;-0;-;@ in the Type box to return a dash instead of zeros.
  • Click OK.

Replace Zeros with Dash or Specific Text

The output will look like the image below.

  • To return specific text, just replace the dash with whatever text you want within double quotes.

I typed NA.

  • Then press OK.

The zeros in the cells now display ‘NA’.


Download Practice Workbook


Related Articles


<< Go Back to Excel Cells | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Md. Sourov Hossain Mithun
Md. Sourov Hossain Mithun

Md. Sourov Hossain Mithun, an Excel and VBA Content Developer at Softeko's ExcelDemy project, joined in October 2021. Holding a Naval Architecture & Marine Engineering degree from BUET, Mithun showcases expertise during his two-year tenure. With over 200 published articles on Excel topics, he earned a promotion to Team Leader, excelling in leading diverse teams. Mithun's passion extends to Advanced Excel, Excel VBA, Data Analysis, and Python programming, contributing significantly to the innovative and dynamic environment of ExcelDemy... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo