1. Home
  2. Functions
  3. Statistical
  4. AVERAGEIF

AVERAGEIF function

Returns the average of the cells that meet a condition.

Syntax

=AVERAGEIF(range, criteria, [average_range])

Arguments

ArgumentRequiredDescription
rangeRequiredThe cells to check
criteriaRequiredThe condition
average_rangeOptionalThe cells to average (the checked cells when left out)

How to use AVERAGEIF

AVERAGEIF takes 2 required arguments and 1 optional argument. Type =AVERAGEIF( in a cell and SheetsBat shows the arguments as you go. Optional arguments are shown in square brackets; leave them out to use their default.

Examples

Each result below was calculated by the SheetsBat formula engine.

=AVERAGEIF(A1:A4, ">2")Result 4
Data in the sheet
A
11
23
35
42
=AVERAGEIF(A1:A3, "y", B1:B3)Result 15
Data in the sheet
AB
1y10
2n99
3y20

Every formula, right in your browser

SheetsBat calculates 536 functions, with charts, pivot tables and live collaboration. Free to start.