Excel tutorial
/

Functions

Intermediate

Excel AVERAGEIFS function: the average with multiple conditions

AVERAGEIFS averages values that meet several conditions: department, city, years of service. Argument order, #DIV/0! and an average without outliers.

AVERAGEIFS calculates the average over rows where every condition is met. “What is the average salary in the sales department in Tashkent?”, “What is the average salary of staff with more than 3 years of service?”, “What was the average receipt at the Samarkand branch in February?”.

In HR, sales and finance analysis this is one of the most common questions: “how much on average — but only for this group”. AVERAGEIFS answers all of them with one formula.

Книга1 - Excel
—☐✕
F2fx=СРЗНАЧЕСЛИМН(D2:D8;A2:A8;"Sales";B2:B8;"Tashkent")
ABCDEFG
1DepartmentCityYearsSalaryQuestionAnswer
2SalesTashkent26 500 000Sales, Tashkent6 866 667
3ITTashkent514 000 000
4SalesSamarkand45 800 000
5SalesTashkent68 900 000
6ITSamarkand17 500 000
7FinanceTashkent39 200 000
8SalesTashkent15 200 000
9
Готово
Three matching employees: (6,500,000 + 8,900,000 + 5,200,000) / 3 ≈ 6,866,667

Syntax

=СРЗНАЧЕСЛИМН(average_range; criteria_range1; criteria1; [criteria_range2; criteria2]; ...)

  • average_range — the numbers to average: D2:D8. It comes first.
  • criteria_range1, criteria1 — the first condition: A2:A8, "Sales".
  • criteria_range2, criteria2 … — more conditions, up to 127 pairs.

The rules match SUMIFS: conditions are joined with “and”, all ranges are the same size. Blank cells and text in average_range are ignored. If no row matches — #DIV/0!.

Step by step: entering AVERAGEIFS

1

Select F2 for the result.

2

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

Книга1 - Excel
—☐✕
ФайлГлавнаяВставкаРазметка страницыФормулыДанныеРецензированиеВидСправка
Вставить функциюАвтосуммаФинансовыеЛогическиеТекстовыеДата и времяСсылки и массивыМатематические
Библиотека функций
Диспетчер имён
Определённые имена
F2fx
ABCDEFG
1DepartmentCityYearsSalaryQuestionAnswer
2SalesTashkent26 500 000Sales, Tashkent
3ITTashkent514 000 000
4
5
Готово

3

First Average_range — D2:D8 (salaries). Then the pairs: A2:A8 and "Sales", B2:B8 and "Tashkent". Click OK.

Книга1 - Excel
—☐✕
F2fx
ABCDEFG
1DepartmentCityYearsSalaryQuestionAnswer
2SalesTashkent26 500 000Sales, Tashkent
3ITTashkent514 000 000
4
5
Готово

4

The result is 6,866,667. The formula: =СРЗНАЧЕСЛИМН(D2:D8;A2:A8;"Sales";B2:B8;"Tashkent").

Example 1: a numeric condition and conditions in cells

A condition on years of service is a plain comparison: =СРЗНАЧЕСЛИМН(D2:D8;A2:A8;"Sales";C2:C8;">=3").

Move the conditions into cells and one formula becomes a “mini calculator”: change the department, city and minimum years and get the answer instantly. With a numeric threshold in a cell, use ">="&F3:

=СРЗНАЧЕСЛИМН(D2:D8;A2:A8;F1;B2:B8;F2;C2:C8;">="&F3)

Книга1 - Excel
—☐✕
F4fx=СРЗНАЧЕСЛИМН(D2:D8;A2:A8;F1;B2:B8;F2;C2:C8;">="&F3)
ABCDEFG
1DepartmentCityYearsSalaryDepartmentSales
2SalesTashkent26 500 000CityTashkent
3ITTashkent514 000 000Min. years21
4SalesSamarkand45 800 000Average salary7 700 000
5SalesTashkent68 900 000Sales, 3+ years7 350 000
6ITSamarkand17 500 000
7FinanceTashkent39 200 000
8SalesTashkent15 200 000
9
Готово
1 — lower the minimum to 1 year and every salesperson in Tashkent is included
Книга1 - Excel
—☐✕
F3fx=СРЗНАЧЕСЛИМН(D2:D8;A2:A8;"IT")
ABCDEFG
1DepartmentCityYearsSalaryFormulaResult
2SalesTashkent26 500 000AVERAGEIF10 750 0001
3ITTashkent514 000 000AVERAGEIFS10 750 0002
4SalesSamarkand45 800 000IT, BukharaNo data
5SalesTashkent68 900 000
6ITSamarkand17 500 000
7FinanceTashkent39 200 000
8SalesTashkent15 200 000
9
Готово
1 and 2 give the same result, but D2:D8 is last in one formula and first in the other. F4: there is no IT staff in Bukhara

Pro level: an average without outliers, and the median

With salaries, prices or real estate, one very large value drags the average along. Two professional techniques:

  • An average without the extremes. Use the average range itself as a condition: =СРЗНАЧЕСЛИМН(D2:D8;D2:D8;">"&МИН(D2:D8);D2:D8;"<"&МАКС(D2:D8)) — the average without the minimum and maximum.
  • A conditional median. There is no “MEDIANIFS”, but in Microsoft 365 =МЕДИАНА(ФИЛЬТР(D2:D8;A2:A8="Sales")) does exactly that.

Show the average and the median side by side in a report, and nobody will draw the wrong conclusion about the “average salary”.

Книга1 - Excel
—☐✕
F3fx=СРЗНАЧЕСЛИМН(D2:D8;D2:D8;">"&МИН(D2:D8);D2:D8;"<"&МАКС(D2:D8))
ABCDEFG
1DepartmentCityYearsSalaryMeasureValue
2SalesTashkent26 500 000AVERAGE8 157 143
3ITTashkent514 000 000No extremes7 580 000
4SalesSamarkand45 800 000MEDIAN7 500 000
5SalesTashkent68 900 000Sales median6 150 000
6ITSamarkand17 500 000
7FinanceTashkent39 200 000
8SalesTashkent15 200 000
9
Готово
A single 14 mln salary lifted the plain average to 8.16 mln. Without the extremes it is 7.58 mln, the median 7.5 mln

Try it in the simulator

Type =СРЗНАЧЕСЛИМН(D2:D8;A2:A8;"Sales";B2:B8;"Tashkent") in F2. Then in F3 calculate the average salary of salespeople with 3+ years: =СРЗНАЧЕСЛИМН(D2:D8;A2:A8;"Sales";C2:C8;">=3").

Книга1 - Excel
—☐✕
Буфер обмена
Шрифт
Выравнивание
Число
Стили
Ячейки
Редактирование
✕✓fx
ABCDEFGHIJKLMNOPQRSTUVWX
1DepartmentCityYearsSalaryQuestionAnswer
2SalesTashkent26500000Sales, Tashkent
3ITTashkent514000000Sales, 3+ years
4SalesSamarkand45800000
5SalesTashkent68900000
6ITSamarkand17500000
7FinanceTashkent39200000
8SalesTashkent15200000
9
10
11
12
Лист1
Готово

Has ExcelLab been useful?

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

Support us
Previous

91 / 154