0
0
Excelspreadsheet~10 mins

Grouping and outlining in Excel - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Sample Data

This data shows categories of items with their names and amounts. We will group rows by category to outline the data.

CellValue
A1Category
B1Item
C1Amount
A2Fruits
B2Apple
C210
A3Fruits
B3Banana
C315
A4Vegetables
B4Carrot
C412
A5Vegetables
B5Broccoli
C58
A6Vegetables
B6Spinach
C65
Formula Trace
SUBTOTAL(9, C2:C3)
Step 1: C2:C3 values = [10, 15]
Step 2: SUM of [10, 15]
Cell Reference Map
    A        B         C
1 Category  Item     Amount
2 Fruits    Apple       10  <-- Included in subtotal
3 Fruits    Banana      15  <-- Included in subtotal
4 Vegetables Carrot     12
5 Vegetables Broccoli    8
6 Vegetables Spinach     5
The formula SUBTOTAL(9, C2:C3) references cells C2 and C3 which contain amounts for Fruits category.
Result
    A        B         C
1 Category  Item     Amount
2 Fruits    Apple       10
3 Fruits    Banana      15
4          Total:      25  <-- Result of SUBTOTAL(9, C2:C3)
5 Vegetables Carrot     12
6 Vegetables Broccoli    8
7 Vegetables Spinach     5
The subtotal 25 is the sum of amounts for Fruits (10 + 15). This can be shown as a total row after the grouped rows.
Sheet Trace Quiz - 3 Questions
Test your understanding
What does the number 9 mean in the formula SUBTOTAL(9, C2:C3)?
AIt means SUM function
BIt means AVERAGE function
CIt means COUNT function
DIt means MAX function
Key Result
SUBTOTAL(function_num, range) calculates a summary like SUM or AVERAGE on a range, useful for grouped data.