0
0
Excelspreadsheet~10 mins

AVERAGEIF and AVERAGEIFS 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
C6130
A7Spinach
B7Vegetable
C790
Formula Trace
=AVERAGEIF(B2:B7, "Fruit", C2:C7)
Step 1: B2:B7 = {"Fruit", "Fruit", "Vegetable", "Vegetable", "Fruit", "Vegetable"}
Step 2: Criteria "Fruit" matches positions 1, 2, and 5 in B2:B7
Step 3: C2:C7 = {100, 150, 80, 120, 130, 90}
Step 4: Select sales values where category is "Fruit": {100, 150, 130}
Step 5: Calculate average of {100, 150, 130}
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  -->  130
7 Spinach  Vegetable  90

Arrows show which sales values are included for "Fruit" category.
The formula checks categories in B2:B7 and picks sales from C2:C7 where category is "Fruit".
Result
    A       B          C          D
1 Product  Category   Sales     Result
2 Apple    Fruit      100      126.67
3 Banana   Fruit      150
4 Carrot   Vegetable  80
5 Broccoli Vegetable  120
6 Orange   Fruit      130
7 Spinach  Vegetable  90

Cell D2 contains the formula =AVERAGEIF(B2:B7, "Fruit", C2:C7) and shows 126.67
The average sales for products in the "Fruit" category is 126.67, shown in D2.
Sheet Trace Quiz - 3 Questions
Test your understanding
Which sales values are included in the average when using =AVERAGEIF(B2:B7, "Fruit", C2:C7)?
A100, 150, 130
B80, 120, 90
CAll sales values
DOnly 100 and 150
Key Result
AVERAGEIF averages values in a range based on one condition; AVERAGEIFS averages values based on multiple conditions.