totn Excel Functions

MS Excel: How to use the AVERAGEIF Function (WS)

This Excel tutorial explains how to use the Excel AVERAGEIF function with syntax and examples.

Description

The Microsoft Excel AVERAGEIF function returns the average (arithmetic mean) of all numbers in a range of cells, based on a given criteria.

The AVERAGEIF function is a built-in function in Excel that is categorized as a Statistical Function. It can be used as a worksheet function (WS) in Excel. As a worksheet function, the AVERAGEIF function can be entered as part of a formula in a cell of a worksheet.

subscribe button Subscribe


If you want to follow along with this tutorial, download the example spreadsheet.

Download Example

Syntax

The syntax for the AVERAGEIF function in Microsoft Excel is:

AVERAGEIF( range, criteria, [average_range] )

Parameters or Arguments

range
The range of cells that you want to apply the criteria against.
criteria
The criteria used to determine which cells to average.
average_range
Optional. It is the cells to average. If average_range is omitted, it uses range as the value for this parameter.

Returns

The AVERAGEIF function returns a numeric value.

Applies To

  • Excel for Office 365, Excel 2019, Excel 2016, Excel 2013, Excel 2011 for Mac, Excel 2010, Excel 2007

Type of Function

  • Worksheet function (WS)

Example (as Worksheet Function)

Let's look at some Excel AVERAGEIF function examples and explore how to use the AVERAGEIF function as a worksheet function in Microsoft Excel:

Microsoft Excel

Based on the Excel spreadsheet above, the following AVERAGEIF examples would return:

=AVERAGEIF(A2:A7, 2012, B2:B7)
Result: 8.2

=AVERAGEIF(A:A, 2011, B:B)
Result: 10

=AVERAGEIF(A2:A7, ">=2012", B2:B7)
Result: 7.8

=AVERAGEIF(A2:A7, "<2013")
Result: 2011.2