Excel AVERAGE Formula to Ignore Blanks, Hyphens, and Zeros
Question details
Calculate an average using valid numeric values while excluding blank cells, hyphens, or 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.
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.
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.
In Excel, click the cell where you want the average to appear.
Type =AVERAGEIF(H3:L3,"<>0") and replace H3:L3 with your own data range.
Press Enter. Excel averages the nonzero numeric values in the selected range.

Use AVERAGE When Hyphens Are Text
Use the standard AVERAGE function when hyphens are text and numeric zeros should remain in the calculation.
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. Open the workbook: Open WPS Office, choose Spreadsheets, and open your workbook.
- 2. Select a result cell: Click the cell where you want to display the average.
- 3. Enter the formula: Type =AVERAGEIF(H3:L3,"<>0"), changing H3:L3 to match your data range.
- 4. Calculate and save: Press Enter to calculate the average, then use File > Save to save the workbook.

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.




