How to Average Without Zeros or Blanks in Excel
By ExcelReady TeamUpdated 6 min read
The short answer
To average without zeros in Excel, use =AVERAGEIF(C2:C9,"<>0"). The criteria "<>0" means not equal to zero, so zero cells are left out of both the total and the count. Blank cells are already ignored by AVERAGE and AVERAGEIF. To add another condition, such as a region, use AVERAGEIFS.
Key takeaways
- =AVERAGEIF(range,"<>0") averages every cell that isn't zero.
- AVERAGE already skips blank cells and text, but it counts zeros.
- Use ">0" instead of "<>0" if you also want to leave out negative numbers.
- AVERAGEIFS adds more conditions: =AVERAGEIFS(C2:C9,B2:B9,"East",C2:C9,"<>0").
- If every value is zero, the result is #DIV/0!; wrap it in IFERROR.
On this page+
- Why zeros pull your average down
- How to average without zeros using AVERAGEIF
- Does AVERAGE ignore blank cells?
- How to ignore zeros and negative numbers
- How to average without zeros with another condition
- How to handle #DIV/0! when every value is zero
- Should missing data be a zero or a blank?
- Other ways to average without zeros
- Practise it
To average without zeros in Excel, use =AVERAGEIF(C2:C9,"<>0"). A zero that really means "no data yet" drags a normal average down, and AVERAGEIF leaves those cells out. Blank cells are a different story: AVERAGE already skips them. This guide shows both cases on one sales table, how to add a second condition, and how to stop #DIV/0! errors.
Why zeros pull your average down#
AVERAGE adds the numbers and divides by how many there are. A zero adds nothing to the total but still counts as one value, so the average shrinks.
Here is the sales table used in this guide, in A1:C9. Ben and Eve show 0 because their figures haven't come in, and Finn's cell is empty:
| A | B | C | |
|---|---|---|---|
| 1 | Rep | Region | Sales |
| 2 | Ana | East | 420 |
| 3 | Ben | West | 0 |
| 4 | Cara | East | 380 |
| 5 | Dan | West | 510 |
| 6 | Eve | East | 0 |
| 7 | Finn | West | |
| 8 | Gia | East | 460 |
| 9 | Hugo | West | 300 |
=AVERAGE(C2:C9) returns 295.71. The total is 2,070, and AVERAGE divides it by 7: the five real figures plus the two zeros. Finn's blank cell isn't counted. The real average of the reps who reported is 2,070 / 5 = 414.
How to average without zeros using AVERAGEIF#
Give AVERAGEIF the range and the criteria "<>0", which means "not equal to zero".
=AVERAGEIF(C2:C9,"<>0")The result is 414. AVERAGEIF checks each cell against the criteria, keeps the ones that pass, and averages only those. The <> operator means "not equal to" in Excel, and it goes inside the double quotes together with the 0.
The full syntax has an optional third argument:
=AVERAGEIF(range, criteria, [average_range])When you leave out average_range, Excel averages the same cells it checks. The AVERAGEIF guide covers the other criteria you can use, and the AVERAGEIF, MAXIFS and MINIFS lesson lets you practise them.
Does AVERAGE ignore blank cells?#
Yes. AVERAGE, AVERAGEIF and AVERAGEIFS all ignore empty cells and cells that contain text. You don't need a special formula to skip blanks.
| Cell holds | Counted by AVERAGE? |
|---|---|
| A number, including 0 | Yes |
| Nothing (empty) | No |
| Text, such as "n/a" | No |
| An empty string "" from a formula | No |
Be careful with cells that only look empty. A cell formatted to hide zeros still holds 0 and still counts. The AVERAGE function guide lists the rules, and the article on AVERAGE, MIN and MAX explains the basics.
How to ignore zeros and negative numbers#
Use ">0" instead of "<>0" when only positive numbers are real data.
=AVERAGEIF(C2:C9,">0")On this table the result is still 414, because there are no negative values. On data with refunds or corrections, ">0" leaves those out too. Choose based on what your negative numbers mean: if a refund of -50 is real, keep "<>0".
How to average without zeros with another condition#
Use AVERAGEIFS, which takes several pairs of range and criteria. Note that the range to average comes first.
=AVERAGEIFS(C2:C9,B2:B9,"East",C2:C9,"<>0")This averages the East sales that aren't zero: Ana, Cara and Gia. The result is (420 + 380 + 460) / 3 = 420. Without the zero test, Eve's 0 would pull the East average down to 315.
The AVERAGEIFS function guide explains the argument order. The same "range first" pattern applies to SUMIFS and COUNTIFS.
How to handle #DIV/0! when every value is zero#
If no cell passes the criteria, AVERAGEIF has nothing to divide by and returns #DIV/0!. This can happen at the start of a month, when every figure is still 0.
=IFERROR(AVERAGEIF(C2:C9,"<>0"),"")IFERROR shows an empty cell instead of the error. You could show a message instead, such as "No data yet". Use IFERROR only around formulas you've tested, because it hides every kind of error, including typing mistakes.
Should missing data be a zero or a blank?#
The cleanest fix is often in the data, not the formula. A zero should mean "the answer is zero": a rep who sold nothing. A blank should mean "we don't know yet". If your sheet follows that rule, a plain AVERAGE gives the right answer, because it skips blanks and keeps real zeros.
Trouble starts when one sheet mixes the two meanings. In the table above, Ben and Eve show 0 only because their figures are late. If Ben really sold nothing this month, leaving him out of the average would make the team look better than it is.
So before you reach for "<>0", ask what each zero means:
- Real result of zero: keep it. Use AVERAGE.
- Placeholder for missing data: leave it out with AVERAGEIF, or better, clear the cell so it's blank.
- A formula that returns 0 when its inputs are empty: change it to return
"", for example=IF(B2="","",B2*C2). AVERAGE skips the empty text.
Other ways to average without zeros#
You may see these alternatives in older workbooks:
- SUM divided by COUNTIF:
=SUM(C2:C9)/COUNTIF(C2:C9,">0")returns 414 here. Be careful:COUNTIF(range,"<>0")also counts blank cells, so with Finn's empty cell it would divide by 6 and give 345. Use">0"for positive data, or just use AVERAGEIF. - Median without zeros: in Excel 2021 or Microsoft 365,
=MEDIAN(FILTER(C2:C9,C2:C9<>0))returns the middle non-zero value, 420. The comparison of AVERAGE vs MEDIAN explains when the median is the better summary.
If some values matter more than others, such as prices weighted by quantity, a plain average is the wrong tool; see how to calculate a weighted average. Leaving out empty listings is also a common task in property reports, covered in Excel skills for real estate.
Practise it#
Conditional averages come up in most Excel tests, and the zero trap is a favourite trick question. Practise AVERAGEIF, MAXIFS and MINIFS in a live spreadsheet: you type the formula and it checks it instantly. If you want to warm up first, practise AVERAGE, MIN and MAX on a simpler table.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
Two reps show 0 because their figures aren't in yet, and Finn's cell is blank. Click E2 and find the average sales without the zeros, using AVERAGEIF on C2:C9.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Sales | |||||
| 2 | ||||||
| 3 | ||||||
| 4 | ||||||
| 5 | ||||||
| 6 | ||||||
| 7 | West | |||||
| 8 | ||||||
| 9 | ||||||
| 10 | ||||||
| 11 | ||||||
| 12 |
Tip: The range is C2:C9 and the criteria is "<>0" in double quotes.
Practise this in a lesson
Frequently asked questions
How do I average a range but ignore zeros in Excel?
Use =AVERAGEIF(range,"<>0"), for example =AVERAGEIF(C2:C9,"<>0"). It adds the non-zero values and divides by how many there are.
Does AVERAGE ignore blank cells?
Yes. AVERAGE ignores empty cells and cells that contain text, so they don't affect the result. It does count cells that contain 0.
How do I average without zeros and with another condition?
Use AVERAGEIFS with the zero test as one of the conditions: =AVERAGEIFS(C2:C9,B2:B9,"East",C2:C9,"<>0") averages the non-zero values for East only.
Why does AVERAGEIF return #DIV/0!?
No cells matched the criteria, so Excel has nothing to divide by. This happens when every value is zero or blank. Use =IFERROR(AVERAGEIF(C2:C9,"<>0"),"") to show a blank instead.
How do I find the median without zeros?
In Excel 2021 or Microsoft 365, use =MEDIAN(FILTER(C2:C9,C2:C9<>0)). FILTER removes the zeros and MEDIAN finds the middle value of what's left.