Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Average Excluding Zeros in Excel

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To average a range while ignoring zeros, use the AVERAGEIF function with the criteria "<>0". For example, if your numbers are in A1:A10, the formula =AVERAGEIF(A1:A10,"<>0") returns the mean of all non-zero cells. This works because AVERAGEIF skips any cell that equals zero, so blank cells and text are also ignored. The result is the sum of the non-zero numbers divided by the count of those numbers. If you need to exclude zeros from multiple ranges or apply more conditions, use AVERAGEIFS instead. Below are the exact steps, plus common pitfalls and fixes.

What You'll Need

  • Microsoft Excel (any recent version for Windows or Mac, or Excel for the web). The AVERAGEIF function is available in Excel 2007 and later.
  • A column or row of numbers that includes zeros you want to exclude.
  • Basic familiarity with entering formulas and selecting cell ranges.

Step-by-Step

  1. Identify your data range. Select the cells that contain the numbers you want to average. For example, if your values are in cells A2 through A20, your range is A2:A20. Make sure the range contains only numbers and zeros; text or blank cells will be ignored by the formula but can affect your understanding of the data.
  2. Click an empty cell where you want the result to appear, such as B2 or a cell below your data column.
  3. Type the AVERAGEIF formula. Enter =AVERAGEIF(A2:A20,"<>0") and press Enter. Replace A2:A20 with your actual range. The criteria "<>0" means "not equal to zero". Excel will calculate the average of all cells in the range that do not contain zero.
  4. Verify the result. The cell should display a number. To double-check, you can manually sum the non-zero values and divide by the count of non-zero values, or use =SUM(A2:A20)/COUNTIF(A2:A20,"<>0") as a cross-check. Both formulas should give the same result.
  5. If you have multiple criteria, use AVERAGEIFS. For example, to average non-zero values in A2:A20 only where the corresponding cells in B2:B20 equal "North", use =AVERAGEIFS(A2:A20,A2:A20,"<>0",B2:B20,"North"). The first argument is the range to average; subsequent pairs are criteria ranges and criteria.
  6. Copy the formula to other cells if needed. Use relative references or absolute references (with $) depending on whether you want the range to stay fixed. For example, =AVERAGEIF($A$2:$A$20,"<>0") keeps the range constant when copied.

Common Mistakes

  • Using AVERAGE instead of AVERAGEIF. The standard AVERAGE function includes zeros in both the sum and the count, which lowers the result. Always use AVERAGEIF or AVERAGEIFS to exclude zeros.
  • Forgetting quotes around the criteria. The criteria must be a text string: "<>0", not <>0. Without quotes, Excel returns an error or misinterprets the formula.
  • Including text or blank cells in the range. AVERAGEIF ignores text and blanks, but if your range includes cells with spaces or formulas returning empty strings, they are treated as text and ignored. This is usually fine, but be aware that the count of non-zero numeric cells may be smaller than expected.
  • Using the wrong range size in AVERAGEIFS. All criteria ranges must be the same size as the average range. If they differ, Excel returns a #VALUE! error.
  • Expecting zeros from formulas to be excluded. A formula that returns 0 is still a zero value. AVERAGEIF will exclude it because the cell evaluates to 0. However, a formula that returns an empty string ("") is text and is ignored, which may or may not be what you want.

Tips

  • Use "<>0" to exclude zeros, but if you also want to exclude blanks, note that AVERAGEIF already ignores blanks. If you want to exclude both zeros and blanks explicitly, use "<>0" and ensure your range doesn't include blank cells that should count as zero.
  • For a quick check, select your range and look at the status bar at the bottom of the Excel window. It shows the average of selected cells, but it includes zeros. Use the formula for the correct result.
  • If you need to average only positive numbers, use ">0" as the criteria. For negative numbers only, use "<0".
  • When working with large datasets, convert your range to an Excel Table (Ctrl+T). Then you can use structured references like =AVERAGEIF(Table1[Sales],"<>0"), which automatically expands as you add data.
  • Remember that AVERAGEIF is not case-sensitive for text criteria, but for numeric criteria like "<>0" case doesn't matter.

Troubleshooting

  • Formula returns #DIV/0! This means no cells in the range meet the criteria (i.e., all cells are zero or blank). Check that your range contains at least one non-zero number.
  • Formula returns #VALUE! Likely a range size mismatch in AVERAGEIFS, or the criteria is not properly quoted. Ensure all ranges are the same dimensions and criteria are in quotes.
  • Result seems too high or too low. Verify that your range doesn't include header text or labels. Also check for cells with numbers stored as text (they are ignored). You can use ISNUMBER to test.
  • Zeros still appear to be included. Confirm that the cells actually contain the number 0 and not text "0" or a formula returning "0" as text. AVERAGEIF treats text "0" as text and ignores it, which might give a different count than expected.
  • Formula doesn't update when data changes. Check that calculation is set to Automatic (Formulas > Calculation Options > Automatic). If set to Manual, press F9 to recalculate.

Frequently Asked Questions

Can I use AVERAGEIF to exclude zeros from multiple columns?

AVERAGEIF works on a single range. To average across multiple non-contiguous ranges while excluding zeros, you can use AVERAGEIFS with multiple ranges if they align, or combine ranges with CHOOSE, but the simplest approach is to consolidate your data into one column or use a helper column that flags zeros.

What's the difference between AVERAGEIF and AVERAGEIFS?

AVERAGEIF applies one criteria to one range. AVERAGEIFS allows multiple criteria across multiple ranges. Use AVERAGEIFS when you need to exclude zeros and also filter by another condition, such as a category or date.

Does AVERAGEIF ignore blank cells?

Yes, AVERAGEIF ignores blank cells, text, and logical values. It only averages cells that meet the criteria and contain numbers. So blanks are effectively excluded.

Can I average excluding zeros without a formula?

You can filter out zeros using AutoFilter (Data > Filter), then select the visible cells and check the status bar average. However, this is manual and not dynamic. The formula approach is recommended for accuracy and automation.

Why does my AVERAGEIF formula return a different result than I expect?

Common causes include criteria not in quotes, range including text that looks like numbers, or cells with formulas returning zero as text. Double-check the range and criteria, and use ISNUMBER to verify numeric cells.

Is there a way to average excluding zeros in Excel for the web?

Yes, AVERAGEIF and AVERAGEIFS are fully supported in Excel for the web. The steps and syntax are the same as in desktop versions.