How to Exclude Zero Values with Formula in Excel (3 Easy Ways)

Method 1 – Use Formula with IF Function to Exclude Zero Values in Excel

Let’s say, we have a dataset displayed in the (B4:D8) cells. Here, the dataset contains 3 columns named Order 1, Order 2, and Result. The dataset has a title called Using IF Function. In the column titled Result, we can see two zero values in cells D6 and D8. Now, we need to omit them.

Use Formula with IF Function to Exclude Zero Values in Excel

Steps:

  • Note that cells in Column D are the sums of the cells in Columns B and C.
  • After selecting cell D6, the Formula Bar is showing the below formula:
=B6+C6

Use Formula with IF Function to Exclude Zero Values in Excel

  • Select cell D5 and type this formula instead:
=IF(B5+C5=0,” “,B5+C5)

Use Formula with IF Function to Exclude Zero Values in Excel

  • Press the Enter button.
  • To copy the results in the other cells, use the Fill Handle.

How Does the Formula Work?

  • B5+C5:

This formula sums up the values of B5 and C5 cells.

  • IF(B5+C5=0,” “,B5+C5):

Here, the IF function will return a void string (“ “) when the summation (B5+C5) is 0. On the other hand, it will return the non-zero result (B5+C5) if the summation is not 0.

  • We can see that the zero values in the D6 and D8 cells are excluded successfully.

Read More: How to Create a Custom Formula in Excel 


Method 2 – Ignore Zero Values with AVERAGEIF Function

Suppose we have a dataset (B5:C9). It contains the numbers and Months of some Orders of a product. Here, the C9 cell shows the average values of the Orders. We can see in the Formula Bar that the AVERAGE function has been used to do so.

Ignore Zero Values with AVERAGEIF Function

Steps:

  • Select cell C9 and type the formula:
=AVERAGEIF(C5:C8,”<>0”)
  • Hit the Enter key.
  • We can see the result in cell C9 now excludes the zero values.


Method 3 – Avoid Zero Values Using Excel FILTER Function

The FILTER function is available on Excel 365, mobile versions, Excel 2019 and newer on Windows, and Excel 2021 and newer on Mac.

Assuming, we have a dataset (B5:D8) that contains a heading named Month, Orders and Filtered Values. The dataset contains zero values in cells C6 and C8.

Avoid Zero Values Using Excel FILTER Function

Steps:

  • Select cell D5.
  • Type this formula:
=FILTER(C5:C8, C5:C8<>0)
  • Hit Enter.

Avoid Zero Values Using Excel FILTER Function

  • We can see that the zero values are omitted in column D.


Download Practice Workbook

Download the practice workbook from here.


Related Articles


<< Go Back to How to Create Excel Formulas | Excel Formulas | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Sagufta Tarannum
Sagufta Tarannum

Sagufta Tarannum, holding a BSc in Naval Architecture & Engineering from Bangladesh University of Engineering and Technology, contributes significantly as an Excel & VBA Content Developer at ExcelDemy. Fueled by a deep interest in research and innovation, she actively engages with Excel. In her role, Sagufta not only skillfully addresses challenging issues but also demonstrates enthusiasm and expertise in gracefully navigating intricate situations, underscoring her unwavering commitment to consistently delivering exceptional content. Her interests are Advanced... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo