Excel tutorial
/

Functions

Intermediate

Excel AVERAGEIF function: the average by a condition

AVERAGEIF averages only the values that meet a condition. Group averages, excluding zeros, #DIV/0! and the zero-versus-blank trap — with examples.

AVERAGEIF averages the numbers only in rows that meet a condition. “What is the average score of group IT-21?”, “What is the average receipt at the Tashkent branch?”, “What are average daily sales, ignoring days off?”.

Plain AVERAGE takes the whole column. AVERAGEIF first picks rows by the condition, then averages only those. Logically it is SUMIF / COUNTIF, but in one function.

Книга1 - Excel
—☐✕
F2fx=СРЗНАЧЕСЛИ(B2:B8;E2;C2:C8)
ABCDEFG
1StudentGroupScoreGroupAverage
2AzizIT-2186IT-2185
3DilnozaIT-2292
4JavohirIT-2174
5KamolaIT-2368
6SardorIT-2279
7MalikaIT-2195
8BekzodIT-2381
9
Готово
IT-21 has three students: (86 + 74 + 95) / 3 = 85

Syntax

=СРЗНАЧЕСЛИ(range; criteria; [average_range])

  • range — where the condition is tested: B2:B8 (groups).
  • criteria — the condition: "IT-21", E2, ">0", ">="&F1, "IT*". Written as in COUNTIF.
  • average_range — the numbers to average: C2:C8. Optional: if omitted, range itself is averaged.

Blank cells and text in average_range are ignored, but zeros are included. If no row matches — #DIV/0!.

Step by step: entering AVERAGEIF

1

Select F2 for the result.

2

Формулы → Вставить функцию → type AVERAGEIF in the search box (category Statistical) and click OK.

Книга1 - Excel
—☐✕
ФайлГлавнаяВставкаРазметка страницыФормулыДанныеРецензированиеВидСправка
Вставить функциюАвтосуммаФинансовыеЛогическиеТекстовыеДата и времяСсылки и массивыМатематические
Библиотека функций
Диспетчер имён
Определённые имена
F2fx
ABCDEFG
1StudentGroupScoreGroupAverage
2AzizIT-2186IT-21
3DilnozaIT-2292
4
5
Готово

3

Range — B2:B8, Criteria — E2 (the group name is in that cell), Average_range — C2:C8. Click OK.

Книга1 - Excel
—☐✕
F2fx
ABCDEFG
1StudentGroupScoreGroupAverage
2AzizIT-2186IT-21
3DilnozaIT-2292
4
5
Готово

4

The result is 85. The formula: =СРЗНАЧЕСЛИ(B2:B8;E2;C2:C8). Type another group in E2 and the result updates by itself.

Example 1: a report for every group

List the groups in column E, lock the ranges with $ and fill the formula down. Averages often come with long decimals — round to one place with ROUND:

=ОКРУГЛ(СРЗНАЧЕСЛИ($B$2:$B$8;E2;$C$2:$C$8);1)

Книга1 - Excel
—☐✕
F3fx=ОКРУГЛ(СРЗНАЧЕСЛИ($B$2:$B$8;E3;$C$2:$C$8);1)
ABCDEFG
1StudentGroupScoreGroupAverage
2AzizIT-2186IT-2185,0
3DilnozaIT-2292IT-2285,5
4JavohirIT-2174IT-2374,5
5KamolaIT-2368All82,1
6SardorIT-2279
7MalikaIT-2195
8BekzodIT-2381
9
Готово
IT-23 is below the overall average — a ready-made signal for analysis

Example 2: an average without zeros, and days above target

The shop is closed on Sunday, so sales that day are 0. Plain AVERAGE counts that zero and artificially lowers “average daily sales”. No average_range is needed — the condition goes on the numbers themselves:

  • =СРЗНАЧЕСЛИ(B2:B8;"<>0") — the average without zeros.
  • =СРЗНАЧЕСЛИ(B2:B8;">="&F1) — the average of days that hit the target in F1.
Книга1 - Excel
—☐✕
F3fx=СРЗНАЧЕСЛИ(B2:B8;"<>0")
ABCDEFG
1DaySalesTarget5 000 000
2Monday4 200 000AVERAGE3 957 143
3Tuesday3 800 000No zeros4 616 667
4Wednesday4 500 000Above target5 650 000
5Thursday3 900 000
6Friday5 100 000
7Saturday6 200 000
8Sunday0
9
Готово
The closed Sunday dragged the average down from 4.6 mln to 3.96 mln
Книга1 - Excel
—☐✕
F2fx=СРЗНАЧЕСЛИ(B2:B6;"IT-21";C2:C6)
ABCDEFG
1StudentGroupScore (0)Score (blank)VersionAverage
2AzizIT-218080With 057,0
3NodirIT-210With blank85,5
4DilnozaIT-227070No such group—
5MalikaIT-219191
6SardorIT-226565
7
Готово
Nodir missed the exam. With 0 the IT-21 average is 57; with a blank cell it is 85.5

Pro level: distance from the group average

  • Compare each row with its own group. =C2-СРЗНАЧЕСЛИ($B$2:$B$8;B2;$C$2:$C$8) — how far a student is above or below their group’s average. Positive means stronger than the group, negative means behind. Add conditional formatting and the weak spots jump out.
  • Several conditions (group and subject) — AVERAGEIFS.
  • A weighted average (by credit hours) can’t be done with AVERAGEIF — use =СУММПРОИЗВ(Scores;Credits)/СУММ(Credits).
  • How many are above average: =СЧЁТЕСЛИ(C2:C8;">"&СРЗНАЧ(C2:C8)).
Книга1 - Excel
—☐✕
D4fx=СРЗНАЧЕСЛИ($B$2:$B$8;B4;$C$2:$C$8)
ABCDEF
1StudentGroupScoreGroup averageDifference
2AzizIT-218685,01,0
3DilnozaIT-229285,56,5
4JavohirIT-217485,0-11,0
5KamolaIT-236874,5-6,5
6SardorIT-227985,5-6,5
7MalikaIT-219585,010,0
8BekzodIT-238174,56,5
9
Готово
With 74 points Javohir is 11 behind his own group, even though he scored higher than Kamola

Try it in the simulator

Type =СРЗНАЧЕСЛИ($B$2:$B$8;E2;$C$2:$C$8) in F2 and fill it down to F4. Which group has the highest average score?

Книга1 - Excel
—☐✕
Буфер обмена
Шрифт
Выравнивание
Число
Стили
Ячейки
Редактирование
✕✓fx
ABCDEFGHIJKLMNOPQRSTUVWX
1StudentGroupScoreGroupAverage
2AzizIT-2186IT-21
3DilnozaIT-2292IT-22
4JavohirIT-2174IT-23
5KamolaIT-2368
6SardorIT-2279
7MalikaIT-2195
8BekzodIT-2381
9
10
11
12
Лист1
Готово

Has ExcelLab been useful?

Support the project and help us release new lessons and exercises.

Support us
Previous

90 / 154