To average a range in Excel while ignoring blank cells, use the AVERAGE function — it automatically skips blanks. For example, =AVERAGE(A1:A10) returns the mean of only the cells that contain numbers, treating empty cells as if they don’t exist. If you need to exclude zeros as well, or handle errors, use AVERAGEIF or AVERAGEIFS. This guide covers the exact steps, common pitfalls, and fixes for when blanks cause unexpected results.
What You’ll Need
- Microsoft Excel (Microsoft 365, Excel 2021, 2019, or earlier — the functions work in all versions).
- A worksheet with a column or row of numeric values that includes some blank cells.
- Basic familiarity with typing formulas in a cell.
Step-by-Step
- Identify your data range. For example, assume your numbers are in cells
A2throughA20, and some of those cells are blank. You want the average of only the filled cells. - Select the cell for the result. Click any empty cell, say
B2, where you want the average to appear. - Type the AVERAGE formula. Enter
=AVERAGE(A2:A20)and press Enter. Excel calculates the mean of all numeric cells in that range, ignoring blanks. With values 10, 20, (blank), 30, the result is 20 — because it sums 60 and divides by 3, not 4. - Use AVERAGEIF to ignore zeros too. If your blanks are fine but you also want to exclude zero values (often mistaken for blanks), type
=AVERAGEIF(A2:A20,"<>0"). This averages only cells that are not equal to zero. For 10, 0, 20, blank, 30, it returns 20 (sum 60 ÷ 3). - Use AVERAGEIFS for multiple conditions. If you need to average based on criteria in another column, say only values where column B equals “Yes”, type
=AVERAGEIFS(A2:A20,B2:B20,"Yes"). This also ignores blanks in the average range. - Handle errors with AGGREGATE. If your range contains
#DIV/0!or other errors, use=AGGREGATE(1,6,A2:A20). The first argument 1 means AVERAGE, the second 6 tells Excel to ignore error values (and it also ignores hidden rows). This works in Excel 2010 and later. - For a dynamic range that grows, convert your data to an Excel Table (select the data, press Ctrl+T). Then use
=AVERAGE(Table1[Values])— the formula automatically includes new rows you add, and blanks are still ignored.
Common Mistakes
- Using AVERAGEA instead of AVERAGE.
AVERAGEAcounts text and logical values (TRUE/FALSE) as 1 or 0, which can skew results. UseAVERAGEfor numeric data only. - Assuming blanks are treated as zero. They are not —
AVERAGEignores them. If you want blanks counted as zero, you need=SUM(A2:A20)/COUNTA(A2:A20)but that also counts text, so it’s usually wrong. Better:=SUM(A2:A20)/ROWS(A2:A20)to include blanks as zeros. - Forgetting that cells with spaces are not blank. A cell containing a space character (typed by accident) is not empty.
AVERAGEwill ignore text, but the cell may affect other formulas. Use=TRIM(A2)to clean data first. - Using AVERAGEIF with wrong criteria. For example,
=AVERAGEIF(A2:A20,"<>0")works, but=AVERAGEIF(A2:A20,"≠0")is invalid. Always use the standard operators:<>,>,<,=. - Not locking the range when copying. If you copy the formula down, relative references change. Use absolute references like
$A$2:$A$20if you want the same range.
Tips
- Use the status bar for a quick check. Select the range with blanks, and look at the bottom-right of Excel — it shows Average, Count, and Sum. The Average there ignores blanks, so you can verify your formula result.
- Combine with IFERROR for clean results. If your range might have errors, wrap the formula:
=IFERROR(AVERAGE(A2:A20),"No data"). - To average only the last N non-blank values, use
=AVERAGE(TAKE(TOCOL(A2:A20,1),-3))in Microsoft 365.TOCOLwith second argument 1 removes blanks, andTAKEwith -3 takes the last 3. - Keyboard shortcut for entering formulas: Press F2 to edit a cell, and Ctrl+Shift+Enter is not needed for AVERAGE (it's not an array formula in normal use).
- On Mac, the same formulas work; keyboard shortcuts use Cmd instead of Ctrl (e.g., Cmd+T for tables).
Troubleshooting
- Average returns #DIV/0! This means no numeric cells were found in the range. Check that your range is correct and that cells contain numbers, not text. If you have text numbers, select them and click the warning icon to convert to number.
- Average seems too high or low. Check for hidden rows or filtered data.
AVERAGEignores hidden rows only when usingSUBTOTALorAGGREGATE. Use=SUBTOTAL(101,A2:A20)to average visible cells only. - Blanks are being counted as zero. This happens if you used
=SUM(A2:A20)/COUNTA(A2:A20)and your blanks are actually cells with a formula that returns "" (empty text). Replace such formulas with truly blank cells, or use=SUM(A2:A20)/COUNT(A2:A20)—COUNTcounts only numbers, ignoring text and blanks. - Formula shows as text. If you see the formula string instead of a result, the cell is formatted as Text. Select the cell, press Ctrl+1, choose General, then press F2 and Enter to recalculate.
- AVERAGEIF returns #VALUE! This often happens if the criteria range and average range are different sizes. Ensure both ranges have the same number of rows and columns.
Frequently Asked Questions
Does AVERAGE ignore blank cells automatically? Yes, AVERAGE ignores empty cells and cells with text or logical values. It only averages numeric values.
How do I average while including blanks as zeros? Use =SUM(A2:A20)/ROWS(A2:A20) — this divides by the total number of cells, counting blanks as zero. For example, with 10, blank, 30, it returns 13.33.
What if my blanks are actually formulas that return ""? Those are not truly blank. Use =AVERAGEIF(A2:A20,"<>",A2:A20) to exclude text, or clean the data by replacing formulas with blanks via Paste Special > Values.
Can I average only the non-blank cells in a filtered list? Yes, use =SUBTOTAL(101,A2:A20) — it averages only visible (non-filtered) cells, ignoring blanks and hidden rows.
Why does AVERAGE ignore cells with zeros? It doesn't — zeros are numeric and are included. If you want to exclude zeros, use =AVERAGEIF(A2:A20,"<>0").
Is there a way to average the last 5 non-blank values without manual selection? In Microsoft 365, use =AVERAGE(TAKE(TOCOL(A2:A20,1),-5)). In older versions, you'd need an array formula or a helper column.
Related
- How to Delete Blank Rows in Excel
- COUNTIF Blank in Google Sheets: Count Empty Cells
- Google Sheets IFS: How to Handle Blank Cells
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Creating Columns in Word: Layout, Breaks, and FixesTo create columns in Microsoft Word for Microsoft 365 on Windows, select the text you want to format,…
- How to Insert a Manual Line Break in Microsoft WordTo insert a manual line break in Word, place the cursor where the new line should begin and…
- Excel Not Responding and Not in Task ManagerIf Excel says Not Responding but you cannot find it in Task Manager, first check the Processes and…
- Contact List Excel Sheet: How to Build and Use OneYes—a contact list Excel sheet is a workbook for storing and organizing names, phone numbers, email addresses, and…
- Habit Tracker Spreadsheet Template: Free Excel SetupYes—you can make a free habit tracker spreadsheet template in Excel using a monthly grid, simple completion totals,…
- JavaScript split() to Array: How It Works and ExamplesYes. JavaScript’s split() method converts a string into an array of substrings, using a separator you specify. For…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.