To get the average of a set of numbers, excluding or ignoring zero values, use the AVERAGEIF function. In the example shown, the formula in E6 is:


Generic formula



In the example shown, the formula in E5 is based on the AVERAGE function:

=AVERAGE(B5:D5) // returns 60

The result is 60, since (90+90+0)/ 3 = 60.

To filter out the zero from the calculated average, the formula in E6 uses the AVERAGEIF function like this:

=AVERAGEIF(B6:D6,"<>0") // returns 90

The criteria supplied is "<>0", which means "not equal to zero".

Blank data values

The AVERAGE, AVERAGEIF, and AVERAGEIFS function all automatically ignore blank cells (and cells that contain text values), so there is no need to provide criteria to filter out empty cells.

Dave Bruns Profile Picture

AuthorMicrosoft Most Valuable Professional Award

Dave Bruns

Hi - I'm Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.