Function Problems

Excel AVERAGE Formula to Ignore Blanks, Hyphens, and Zeros

Chanuka GeekiyanageChanuka Geekiyanage Dec 2, 2026 868 views

Question details

Calculate an average using valid numeric values while excluding blank cells, hyphens, or zeros.

Excel AVERAGE Formula to Ignore Blanks, Hyphens, and Zeros
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet range contains cells that appear blank or display hyphens, and the user wants to average only valid data.
Observed behavior
The desired result is an average of the applicable numeric values, without counting blanks, text hyphens, or unwanted zeros.
Before you start

Select a cell that displays a hyphen and check the formula bar to see whether it contains text, a zero, or a formula. Open Format Cells from the right-click menu to check whether a number format displays zero as a hyphen.

Solution 1Recommended

Use AVERAGEIF to Exclude Zeros from the Range

Use this formula when zeros should not be included, including zeros displayed as hyphens.

AVERAGEIF averages numeric values that meet the condition. Blank cells and text values, including text hyphens, are not included in the average.

1
Select the result cell

In Excel, click the cell where you want the average to appear.

2
Enter the formula

Type =AVERAGEIF(H3:L3,"<>0") and replace H3:L3 with your own data range.

3
Calculate the result

Press Enter. Excel averages the nonzero numeric values in the selected range.

Use AVERAGEIF to Exclude Zeros from the Range
No qualifying numbers: If the range contains no qualifying numeric values, the formula returns #DIV/0!. To display a blank instead, use =IFERROR(AVERAGEIF(H3:L3,"<>0"),""). This also hides other formula errors.
Calculate averages in WPS Spreadsheets

Average Nonzero Values in WPS Spreadsheets

Use AVERAGEIF in WPS Spreadsheets to average nonzero numbers while leaving blank cells and text hyphens out of the calculation.

  1. 1. Open the workbook: Open WPS Office, choose Spreadsheets, and open your workbook.
  2. 2. Select a result cell: Click the cell where you want to display the average.
  3. 3. Enter the formula: Type =AVERAGEIF(H3:L3,"<>0"), changing H3:L3 to match your data range.
  4. 4. Calculate and save: Press Enter to calculate the average, then use File > Save to save the workbook.
Exclude zeros from an average with AVERAGEIFOpen and edit Microsoft Excel XLSX and XLS filesUse familiar spreadsheet formulas and cell rangesWork with spreadsheets in the free version of WPS Office
microsoft office alternative - wps office

Frequently Asked Questions

Does AVERAGE ignore blank cells in Excel?

Yes. A formula such as =AVERAGE(H3:L3) ignores blank cells in the referenced range, but it includes numeric zeros.

Why is a cell that shows a hyphen counted as zero?

The cell may contain a numeric zero displayed as a hyphen by its number format. Select the cell and check the formula bar and the right-click Format Cells menu. Use =AVERAGEIF(H3:L3,"<>0") if you want to exclude zeros.

How do I exclude both text hyphens and zeros?

Enter =AVERAGEIF(H3:L3,"<>0") in the result cell, replacing the range as needed. Text hyphens are not averaged, and the condition excludes numeric zeros.

Why does my average formula return #DIV/0!?

This can happen when no numeric values qualify for the average. Check the cells in the range, or use =IFERROR(AVERAGEIF(H3:L3,"<>0"),"") to display a blank instead. IFERROR also hides other errors.