0
0
Excelspreadsheet~10 mins

SUMIF and SUMIFS in Excel - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Sample Data

Sales data for products with their categories and sales amounts.

CellValue
A1Product
B1Category
C1Sales
A2Apple
B2Fruit
C2100
A3Banana
B3Fruit
C3150
A4Carrot
B4Vegetable
C480
A5Broccoli
B5Vegetable
C5120
A6Orange
B6Fruit
C690
Formula Trace
=SUMIF(B2:B6, "Fruit", C2:C6)
Step 1: B2:B6 = {"Fruit", "Fruit", "Vegetable", "Vegetable", "Fruit"}
Step 2: Criteria "Fruit" applied to B2:B6
Step 3: C2:C6 = {100, 150, 80, 120, 90}
Step 4: Sum values in C2:C6 where B2:B6 is "Fruit"
Cell Reference Map
    A       B          C
1 Product  Category   Sales
2 Apple    Fruit  ---> 100
3 Banana   Fruit  ---> 150
4 Carrot   Vegetable 80
5 Broccoli Vegetable 120
6 Orange   Fruit  ---> 90

Arrows show which sales values are summed based on category "Fruit" in column B.
The formula checks categories in B2:B6 and sums corresponding sales in C2:C6 where category is "Fruit".
Result
    A       B          C          D
1 Product  Category   Sales      Result
2 Apple    Fruit      100        
3 Banana   Fruit      150        
4 Carrot   Vegetable  80         
5 Broccoli Vegetable  120        
6 Orange   Fruit      90         
7                        =SUMIF(B2:B6, "Fruit", C2:C6) => 340
The formula in D7 sums sales for all products in the Fruit category, resulting in 340.
Sheet Trace Quiz - 3 Questions
Test your understanding
What does the formula =SUMIF(B2:B6, "Fruit", C2:C6) do?
AAdds sales amounts for products in the Fruit category
BAdds all sales amounts regardless of category
CCounts how many products are in the Fruit category
DAdds sales amounts for products not in the Fruit category
Key Result
SUMIF sums values in one range based on a single condition applied to another range.