Please Note: This article is written for users of the following Microsoft Excel versions: 2007 and 2010. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: An Average that Excludes Zero Values.

An Average that Excludes Zero Values

by Allen Wyatt
(last updated September 9, 2016)


Veronica knows how to use the AVERAGE function to determine the average of a range of values. She would like to have the average determined based on the non-zero values in the range, however.

The worksheet function most suited to this purpose is to use AVERAGEIF. You can use it in this manner:


This function only includes in the average those cells that contain values greater than zero. If you want to also exclude blank cells, you should use the AVERAGEIFS function. This function differs from AVERAGEIF in that it allows you to specify multiple criteria that indicate which cells to average.


Of course, if you want to approach the problem "old school" (without using AVERAGEIF or AVERAGEIFS), then there are several ways you can proceed. The first is to remember how an average is calculated. It is defined as the sum of a range of values divided by the number of items in the range. Thus, you could figure the exclusionary average by simply making sure that the denominator (the number you are dividing by) does not include any zero values. For instance:


This approach uses the COUNTIF function to determine the number of cells in the range (A1:A50) that don't contain zero. If this range contains not only zeros but also blank cells, and you don't want the blank cells figured into the result, then you need to use a more complex formula:


The COUNTIF function counts cells that do not explicitly evaluate to 0, but it will count blank and text cells. The COUNTBLANK term adjusts for the blank cells and the difference between COUNTA and COUNT adjusts the total count for cells that contain text.

Of course you can also use an array formula to do your calculation:


Remember that array formulas need to be entered by using the combination Ctrl+Shift+Enter. This array formula also excludes blanks or cells containing text.

All in all it is easier to use the AVERAGEIF or AVERAGEIFS functions. When would you not want to use them? When you need to share your workbook with users of Excel versions prior to Excel 2007. (This is when the functions were added to Excel.)

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (7729) applies to Microsoft Excel 2007 and 2010. You can find a version of this tip for the older menu interface of Excel here: An Average that Excludes Zero Values.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...


Using Parallel Columns

Users of WordPerfect know what parallel columns are. There is no such capability in Word, but there are ways you can achieve ...

Discover More

Adding a Break to Your Document

Want to modify the way your text flows between pages in a document? Word allows you to insert several types of breaks that ...

Discover More

Can't Access the Registry

Many Windows applications rely on information stored in the Registry. If that information cannot be accessed, the application ...

Discover More

Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!

More ExcelTips (ribbon)

Averaging a Non-Contiguous Range

Figuring out how to average data that is in a contiguous range of cells is easy. When the data is spread over a group of ...

Discover More

Determining a Simple Moving Average

A moving average can be a great way to analyze a series of data points that you've collected over time. Setting up a formula ...

Discover More

Averaging the Last Numbers in a Column

Need to calculate a running average for the last twelve values in a constantly changing range of values? The formula ...

Discover More

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.


If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is two less than 2?

2016-08-28 11:39:11

Larry K. Binning

I have a row of numbers that are added to each week. I need to calculate the average for the last 7 weeks excluding zeros or blanks when they occur and removing the max and min of the 7 numbers calculating the average on the 5 remaining numbers. Is there a convenient way to do this.


2016-06-11 05:45:58

Michael (Micky) Avidan

It sounds as if your calculation have changed from "Automatic" to "manual".
(Check it according to your Excel version)
Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” MVP – Excel (2009-2016)

2016-06-10 09:11:40


I am trying to write a formula where you calculate the average, and excluding any blank or zero value cells, then take the average sum and subtract the lower amount from it to the sum total. This is for calculating cost savings. I've got the average part excluding the zero values (and as per your not above) hold the shift+cntrl+enter. BUT whenever I change a value in one of the cells, it does not update the value, I have to go back in and hold shift+cntrl+enter again. Help!

2016-05-24 11:04:34

Willy Vanhaelen

@Sharyn Kingston

Look in Excel's Help and you will find: "If a range or cell reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included."

So you have to do nothing special because what you want is simply the default.

2016-05-23 22:56:09

Sharyn Kingston

Can you please tell me how to do an average that includes zero values, but still excludes cells with no value?

2016-05-18 08:45:52



2016-05-04 05:31:33

Michael (Micky) Avidan

The AVERAGE Function discards empty cells - so there is no problme for the manager to leave them empty.
Take a look at the picture.
(see Figure 1 below)
Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” MVP – Excel (2009-2016)

Figure 1. 

2016-05-04 01:16:29


if column I is an average of the week. If the manager didn't fill out a cell, don't allow that to average in. Just do an average of what was a pplied the formula

2016-02-25 01:28:17



2015-10-12 13:07:26


Averaging a non-contiguous range:

2015-10-12 12:47:28


I have a similar situation as Todd

2015-09-17 18:00:57


seems all the examples show the cells to be averaged in range are in a continuous row. I need to do this function where I need the average of items in about every 3rd cell of a row, and not the whole row. the range includes all cells correct, am I looking at an array??

2015-08-29 10:06:42


Thanks a lot.

2015-07-23 07:13:58

Michael (Micky) Avidan

In your example it should read:


Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” MVP – Excel (2009-2015)

2015-07-23 07:12:45

Michael (Micky) Avidan

This tip was intended for 2003 and eralier versions users.
However, starting with Excel 2007 - the following formula will achieve the same task without the need for an ampersand.
By the way - the following formula takes into calculation also negative values, therefor I used: "<>0".


Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” MVP – Excel (2009-2015)

2015-07-22 10:33:03


I had to make a slight change to get it to work for me (Excel 2013). I wanted it documented in case others have a similar problem:


is changed to


Notice the ampersand in the fourth to last character.

2015-04-12 04:19:13


Really struggling with a Average Function..

I have a range of cells (M9:M18)that have one of three quantities: 100, 50, 0.

These quantities are filled in based on the formula used in the cell to the left of them.

I need to use a formula to come up with an average for these cells and have had no luck with all of the threads I've tried.


2015-03-01 10:20:36

alec macleod

I want to average monetary values on different sheets with in the same work book that do not include zero

2015-02-05 12:47:06


I am wondering how to average a range of cells that include the SUM formula for a line of numbers, but eliminate the cells that do not have a calculation to the sum formula. There may be a '0' input in one of the cells, so I can't just eliminate 0. Is there a way to eliminate the cells that only have the formula without the actual calculation??

2014-12-23 06:40:29



Great tips!

The current AverageIf forumla works well for me. But the problem is it's counting all the Zero's in my data. Are you able to provide guidance on how i add into this formula the exclusion of Zero's?

=AVERAGEIF('YTD PPV - 410'!$A:$A,'Aus - YTD @ Standard'!$B$54&'Aus - YTD @ Standard'!B55,'YTD PPV - 410'!$P:$P)

Many thanks

2014-11-24 14:20:45


The first formula given:


does not do what Veronica wants since there may be negative values in the range. She should instead use:


2014-11-11 02:06:06

Ricardo A. Reyes

this is my first visit in this site and i was looking for formula that meet my demands, with the help of google I found this site. it is very well explained and was very helpful. thanks you so much. keep up the good work. and hope this site last.

2014-10-14 04:27:17


Very well explained, thank you !

2013-04-28 01:14:24


Thank you, well explained !

2013-04-24 16:29:19


First tutorial I found that actually works, went through about 3-4 others.


2013-03-06 16:55:17

André Terra

Thanks! First hit on google for "average excluding ifs" ;)

This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.