Excel Formula to Average Numbers Excluding Zeros

📅 Mar 23, 2026 📝 Sarah Miller

Calculating accurate analytical metrics in Excel often gets derailed when zero values skew your overall averages. When evaluating standard funding sources and operational budgets, these zeros typically represent inactive projects rather than true underperformance. Excluding these non-contributing figures grants stakeholders a far more realistic baseline of active resource allocation. As a critical stipulation, however, users must ensure that genuine blank cells are not conflated with explicit zero entries. For instance, analyzing municipal grant distributions requires isolating active capital from unfunded initiatives. Below, we will define the exact AVERAGEIF formula structure to seamlessly omit zeros from your datasets.

Excel Formula to Average Numbers Excluding Zeros

Excel Formula to Average Numbers with Zeros Excluded

A comprehensive guide to calculating accurate averages in Microsoft Excel by ignoring zero values, utilizing AVERAGEIF, AVERAGEIFS, array formulas, and error-handling techniques.


When analyzing datasets in Microsoft Excel, calculating the arithmetic mean (average) is one of the most fundamental tasks. By default, Excel's standard AVERAGE function sums all the numbers in a designated range and divides that sum by the total count of cells containing numeric values.

However, real-world data is rarely perfect. Often, datasets contain zeros (0) that represent missing data, unrecorded transactions, out-of-stock items, or placeholders. If you include these zeros in your calculations, they will artificially drag down your average, leading to skewed analysis and faulty business decisions. To get an accurate representation of your active, meaningful data, you must exclude these zeros from your calculations.

In this guide, we will explore the most efficient and robust ways to average numbers in Excel while excluding zeros, ranging from basic formulas to advanced multi-criteria approaches.

The Problem with the Standard AVERAGE Function

Before diving into the solutions, it is crucial to understand how Excel treats different types of empty or null-like data. Excel's standard AVERAGE function automatically ignores blank (empty) cells and cells containing text. However, it does not ignore zeros.

Consider the following dataset representing daily sales for a small retail store over five days:

Day (Row) Sales Amount (Column B)
Monday (B2) $150
Tuesday (B3) $200
Wednesday (B4) $0 (Store closed for maintenance)
Thursday (B5) $250
Friday (B6) [Blank Cell] (Data not entered)
  • If you use the standard formula =AVERAGE(B2:B6), Excel will sum the values ($150 + $200 + $0 + $250 = $600) and divide by 4 (ignoring the blank cell on Friday, but counting Wednesday's $0). The result is $150.
  • If Wednesday's zero is excluded because the store was closed, the true average sales for active days should be calculated as ($150 + $200 + $250 = $600) divided by 3. The correct result should be $200.

Method 1: The Modern Standard – The AVERAGEIF Function

The simplest and most efficient way to average a range while excluding zeros is by using the AVERAGEIF function. Introduced in Excel 2007, this function allows you to calculate the average of cells that meet a single specific criterion.

The Syntax

=AVERAGEIF(range, criteria, [average_range])
  • range: The range of cells you want to evaluate based on your criteria (e.g., B2:B6).
  • criteria: The condition that defines which cells to average. To exclude zeros, we use the logical "not equal to" operator combined with zero: "<>0".
  • average_range (Optional): The actual cells to average if they differ from the evaluation range. If omitted, Excel averages the cells in the primary range.

The Formula in Action

To calculate the average of our sales data while ignoring both the blank cell and the zero value, apply the following formula:

=AVERAGEIF(B2:B6, "<>0")

When Excel processes this formula, it scans the range B2:B6, flags the cells that do not equal zero, ignores the blank cell, and returns the mathematically accurate average of $200.

Method 2: Multi-Criteria Averaging with AVERAGEIFS

What if you need to exclude zeros but also apply additional logical constraints? For example, you may want to calculate the average sales of a specific product category, but only for transactions greater than zero.

In this scenario, you should use the AVERAGEIFS function, which supports multiple criteria. Note that the syntax structure of AVERAGEIFS is slightly different: the range containing the numbers to average is placed first.

The Syntax

=AVERAGEIFS(average_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)

Example Scenario

Imagine a real estate sales sheet where column B contains the "Property Type" (e.g., Condo, House), and column C contains the "Commission Earned". Some commissions are recorded as $0 because transactions are pending. To find the average commission for "Condo" sales while excluding zero values, you would write:

=AVERAGEIFS(C2:C10, B2:B10, "Condo", C2:C10, "<>0")

In this formula:

  • C2:C10 is the range containing the values to be averaged.
  • B2:B10, "Condo" restricts the calculation solely to properties categorized as "Condo".
  • C2:C10, "<>0" ensures that any commission values of zero within those matched rows are entirely ignored.

Method 3: The Traditional Array Formula (For Older Excel Versions or Complex Logic)

Before the release of AVERAGEIF and AVERAGEIFS, financial analysts relied on combining the AVERAGE and IF functions into an array formula. While modern Excel functions make this method less common, it remains highly valuable for complex logical operations where standard functions fall short.

The Formula

=AVERAGE(IF(B2:B6<>0, B2:B6))

How to Enter It

  • In Modern Excel (Microsoft 365, Excel 2021, and newer): You can simply type the formula and press Enter. Excel's dynamic array engine will automatically evaluate it.
  • In Legacy Excel (Excel 2019 and older): You must enter this as a traditional array formula by pressing Ctrl + Shift + Enter instead of just Enter. When done correctly, Excel wraps the formula in curly braces: {=AVERAGE(IF(B2:B6<>0, B2:B6))}.

How It Works Behind the Scenes

The nested IF statement evaluates every cell in the range B2:B6. If a cell value does not equal zero, the IF function returns that value. If the cell does equal zero, it returns FALSE. This creates an internal array in Excel's memory that looks like this: {150, 200, FALSE, 250, FALSE}. Because the AVERAGE function is programmed to ignore logical values like FALSE, it averages only the numeric components, returning 200.

Method 4: Preventing the #DIV/0! Error

One common pitfall when excluding zeros is the risk of encountering the #DIV/0! error. If your selected data range contains only zeros and blank cells, your formula will successfully exclude all values, leaving nothing to divide by.

To make your spreadsheets look professional and prevent broken calculations downstream, wrap your averaging formulas inside the IFERROR function.

The IFERROR Wrapper Formula

=IFERROR(AVERAGEIF(B2:B6, "<>0"), 0)

In this formula, if the AVERAGEIF function returns a valid number, that number is displayed. If the range has nothing but zeros and triggers a division-by-zero error, the formula quietly catches the error and returns a clean 0 (or any custom text you choose, such as "No Sales").

=IFERROR(AVERAGEIF(B2:B6, "<>0"), "No Active Transactions")

Quick Comparison of Methods

Choosing the right formula depends on your version of Excel and the structure of your data. Use this quick reference table to make the right choice:

Formula Style Ideal For Complexity Pros / Cons
AVERAGEIF Standard, single-criteria calculations. Low Cleanest syntax; easiest to write and maintain.
AVERAGEIFS Averaging with multiple criteria exclusions. Medium Highly flexible; handles multiple complex filters.
AVERAGE(IF(...)) Advanced dynamic logical arrays. High Powerful but requires CSE entry in older Excel versions.
IFERROR(AVERAGEIF(...)) Professional dashboards and templates. Medium Prevents messy error messages from displaying.

Summary

Excluding zeros from an average calculation is a fundamental step toward achieving clean, accurate data reporting. For most daily tasks, the simple =AVERAGEIF(range, "<>0") formula is your best choice. If you require multi-layered logical criteria, leverage AVERAGEIFS, and always consider wrapping your final calculation in an IFERROR statement to maintain a polished, professional workbook interface.

Disclaimer:
The documents and templates provided on this page are for informational and illustrative purposes only. They do not constitute professional, legal, or financial advice, and should not be relied upon as such. Because individual circumstances and regulatory requirements vary, these materials may not be suitable for your specific needs. We recommend consulting with a qualified professional before adapting or using any of these examples for official or commercial purposes.