0
0
Google Sheetsspreadsheet~10 mins

AVERAGEIF and AVERAGEIFS in Google Sheets - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Sample Data

This table shows names of students in column A and their test scores in column B.

CellValue
A1Name
B1Score
A2Alice
B285
A3Bob
B390
A4Alice
B478
A5Charlie
B592
A6Bob
B688
A7Alice
B795
Formula Trace
=AVERAGEIF(A2:A7, "Alice", B2:B7)
Step 1: Check each cell in A2:A7 if it equals "Alice"
Step 2: Select scores from B2:B7 where corresponding A cells are TRUE
Step 3: Calculate average of [85, 78, 95]
Cell Reference Map
    A       B
1 |Name   |Score
2 |Alice  | 85  
3 |Bob    | 90  
4 |Alice  | 78  
5 |Charlie| 92  
6 |Bob    | 88  
7 |Alice  | 95  

Formula references:
- A2:A7 for criteria range
- B2:B7 for average range
The formula looks at names in A2:A7 to find 'Alice' and averages the matching scores in B2:B7.
Result
    A       B       C
1 |Name   |Score  | Result
2 |Alice  | 85    | 86
3 |Bob    | 90    |
4 |Alice  | 78    |
5 |Charlie| 92    |
6 |Bob    | 88    |
7 |Alice  | 95    |
The result 86 is the average score of all rows where the name is Alice.
Sheet Trace Quiz - 3 Questions
Test your understanding
What does the formula =AVERAGEIF(A2:A7, "Alice", B2:B7) do?
AIt averages scores in B2:B7 only for rows where A2:A7 is 'Alice'.
BIt averages all scores in B2:B7 regardless of names.
CIt counts how many times 'Alice' appears in A2:A7.
DIt sums all scores in B2:B7 for 'Bob'.
Key Result
AVERAGEIF averages values in one range based on a single condition in another range.