SUMIF & SUMIFS function
๐ Excel Functions: SUMIF
and SUMIFS
โ 1. SUMIF Function
๐ง Purpose:
SUMIF
is used to sum values based on a single condition.
๐ Syntax: SUMIF(range, criteria, [sum_range])
๐ Parameters:
-
range โ The range of cells to evaluate against the criteria.
-
criteria โ The condition that determines which cells to sum.
-
sum_range (optional) โ The actual cells to sum. If omitted, Excel sums the cells in the
range
.
๐งพ Example:
๐๏ธ Data:
A (Product) | B (Sales) |
---|---|
Apple | 100 |
Banana | 150 |
Apple | 200 |
๐ฏ Goal:
Sum the sales of "Apple".
โ Formula: =SUMIF(A2:A4, "Apple", B2:B4)
๐ค Result:
300
๐ช Step-by-Step:
-
Type the function
=SUMIF(
. -
Select the range to evaluate (e.g.,
A2:A4
). -
Type the condition (e.g.,
"Apple"
). -
Select the range to sum (e.g.,
B2:B4
). -
Press Enter to get the result.
โ 2. SUMIFS Function
๐ง Purpose:
SUMIFS
is used to sum values based on multiple conditions.
๐ Syntax:
๐ Parameters:
-
sum_range โ The range of cells to add.
-
criteria_range1 โ The first range to evaluate.
-
criteria1 โ The condition for the first range.
-
[criteria_range2, criteria2]... โ Additional ranges and criteria (optional).
๐งพ Example:
๐๏ธ Data:
A (Product) | B (Region) | C (Sales) |
---|---|---|
Apple | East | 100 |
Banana | West | 150 |
Apple | East | 200 |
Apple | West | 100 |
๐ฏ Goal:
Sum the sales of "Apple" in the "East" region.
โ Formula:=SUMIFS(C2:C5, A2:A5, "Apple", B2:B5, "East")
๐ค Result: 300
๐ช Step-by-Step:
-
Type the function
=SUMIFS(
. -
Select the sum_range (e.g.,
C2:C5
). -
Select the first criteria_range (e.g.,
A2:A5
) and set the criteria (e.g.,"Apple"
). -
Select the second criteria_range (e.g.,
B2:B5
) and set the criteria (e.g.,"East"
). -
Press Enter.
๐ Tips & Notes
-
Wildcards: Use
*
for any number of characters,?
for a single character in text-based criteria. -
Comparison Operators: You can use operators like
">100"
or"<200"
. -
SUMIFS
is more powerful thanSUMIF
because it can handle multiple conditions.