Excel tutorial
/

Functions

Intermediate

Excel SUMIF function: sum by a condition — step by step

SUMIF adds up only the rows that meet a condition: city, category, ">="&F1, the * wildcard. The shifted-range trap and pro techniques.

SUMIF adds up numbers only in the rows that meet a condition. “What are total sales for Tashkent?”, “How much went on transport?”, “What is the sum of orders over 1 mln?” — each is one SUMIF.

It replaces “filter, then add up on a calculator”, and when the data changes the result updates by itself. Half of all small reports are built on SUMIF.

Книга1 - Excel
—☐✕
F2fx=СУММЕСЛИ(B2:B7;"Tashkent";C2:C7)
ABCDEFG
1ManagerCityAmountCityTotal
2AzizTashkent1 250 000Tashkent4 260 000
3DilnozaSamarkand640 000
4JavohirTashkent2 100 000
5KamolaBukhara480 000
6SardorTashkent910 000
7MalikaSamarkand1 730 000
8
Готово
Rows with “Tashkent” in column B are picked and their amounts in C are added: 1,250,000 + 2,100,000 + 910,000

Syntax

=СУММЕСЛИ(range; criteria; [sum_range])

  • range — where the condition is tested: B2:B7 (cities).
  • criteria — the condition: "Tashkent", ">=1000000", ">="&F1, "Ph*". Written the same way as in COUNTIF.
  • sum_range — the numbers to add: C2:C7. Optional: leave it out and Excel adds up range itself — handy when the condition is on the numbers: =СУММЕСЛИ(C2:C7;">=1000000").

Remember the order: condition first, then the sum. SUMIFS is the other way round — a major source of mistakes.

Step by step: entering SUMIF

1

Select F2 for the result.

2

Формулы → Математические → pick SUMIF from the list.

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

3

Range — B2:B7 (cities), Criteria — "Tashkent" or cell E2, Sum_range — C2:C7 (amounts). Click OK.

Книга1 - Excel
—☐✕
F2fx
ABCDEFG
1ManagerCityAmountCityTotal
2AzizTashkent1 250 000Tashkent
3DilnozaSamarkand640 000
4
5
Готово

4

The result is 4,260,000. The finished formula: =СУММЕСЛИ(B2:B7;"Tashkent";C2:C7).

Example 1: one formula — a whole report

List the cities in column E and take the condition from the cell. Lock the ranges with $, fill the formula down, and you have a total for every city:

=СУММЕСЛИ($B$2:$B$7;E2;$C$2:$C$7)

Check: the city totals must add up to the overall SUM.

Книга1 - Excel
—☐✕
F3fx=СУММЕСЛИ($B$2:$B$7;E3;$C$2:$C$7)
ABCDEFG
1ManagerCityAmountCityTotal
2AzizTashkent1 250 000Tashkent4 260 000
3DilnozaSamarkand640 000Samarkand2 370 000
4JavohirTashkent2 100 000Bukhara480 000
5KamolaBukhara480 000All7 110 000
6SardorTashkent910 000Check7 110 000
7MalikaSamarkand1 730 000
8
Готово
The formula from F2 is filled to F4: the condition comes from column E, the ranges stay put. All = Check — nothing was missed

Example 2: no sum_range, the * wildcard and a threshold in a cell

  • When the condition is on the numbers themselves, you don’t need the third argument: =СУММЕСЛИ(B2:B6;">="&F1) — the total of products priced at F1 or more.
  • By part of the text: =СУММЕСЛИ(A2:A6;"Phone*";B2:B6) — every product whose name starts with “Phone”.

Note: when the threshold is in a cell, the sign stays in quotes and the cell is joined with &.

Книга1 - Excel
—☐✕
F3fx=СУММЕСЛИ(A2:A6;"Phone*";B2:B6)
ABCDEFG
1ProductAmountThreshold3 000 000
2Phone Samsung A152 450 000Above threshold17 100 000
3Phone iPhone 137 900 000Phone*12 200 000
4Laptop HP6 200 000
5Phone Redmi 121 850 000
6Tablet Samsung3 000 000
7
Готово
F2: no sum_range — column B itself is added. F3: the total of the three phones
Книга1 - Excel
—☐✕
F3fx=СУММЕСЛИ(B2:B7;"Tashkent";C3:C8)
ABCDEFG
1ManagerCityAmountVersionResult
2AzizTashkent1 250 000Right: C2:C74 260 000
3DilnozaSamarkand640 000Shifted: C3:C82 850 000
4JavohirTashkent2 100 000
5KamolaBukhara480 000
6SardorTashkent910 000
7MalikaSamarkand1 730 000
8
Готово
The shifted version added the yellow cells — the row after each Tashkent row. And no error sign at all!

Pro level: running totals, shares and “or”

  • A running total within a category. =СУММЕСЛИ($B$2:B2;B2;$C$2:C2) — the start of the range is locked, the end grows downward. Each row shows how much that city has accumulated so far.
  • A share. =СУММЕСЛИ(B2:B7;"Tashkent";C2:C7)/СУММ(C2:C7) — what percentage of sales comes from Tashkent.
  • “Or”. =СУММ(СУММЕСЛИ(B2:B7;{"Tashkent";"Samarkand"};C2:C7)) — two cities together.
  • Blank cells. =СУММЕСЛИ(B2:B7;"";C2:C7) — the total of orders with no city entered. Very useful for checking data quality.
  • Two or more conditions (city and month) — that’s SUMIFS.
Книга1 - Excel
—☐✕
D6fx=СУММЕСЛИ($B$2:B6;B6;$C$2:C6)
ABCDE
1ManagerCityAmountRunning total by city
2AzizTashkent1 250 0001 250 000
3DilnozaSamarkand640 000640 000
4JavohirTashkent2 100 0003 350 000
5KamolaBukhara480 000480 000
6SardorTashkent910 0004 260 000
7MalikaSamarkand1 730 0002 370 000
8
Готово
D6 accumulates Tashkent’s three orders: 1,250,000 + 2,100,000 + 910,000

Try it in the simulator

Type =СУММЕСЛИ($B$2:$B$7;E2;$C$2:$C$7) in F2 and fill it down to F4 — you get a total for each city. Then type =СУММ(F2:F4) in F5 and compare it with the overall total.

Книга1 - Excel
—☐✕
Буфер обмена
Шрифт
Выравнивание
Число
Стили
Ячейки
Редактирование
✕✓fx
ABCDEFGHIJKLMNOPQRSTUVWX
1ManagerCityAmountCityTotal
2AzizTashkent1250000Tashkent
3DilnozaSamarkand640000Samarkand
4JavohirTashkent2100000Bukhara
5KamolaBukhara480000All
6SardorTashkent910000
7MalikaSamarkand1730000
8
9
10
11
Лист1
Готово

Has ExcelLab been useful?

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

Support us
Previous

88 / 154