Think about what grouping does to help you manage large data sets.
Grouping rows hides them temporarily and adds a button to expand or collapse the group, making it easier to view or hide details.
=SUBTOTAL(9, B2:B20)SUBTOTAL can ignore hidden rows depending on the function number used.
SUBTOTAL with function_num 9 sums only visible rows, so it excludes rows hidden by grouping.
Outline levels control how detailed the view is.
Clicking level 2 shows the first level groups (Region) expanded but keeps the second level groups (Salesperson) collapsed.
SUBTOTAL has special behavior with hidden rows.
SUBTOTAL with function_num 1 calculates average ignoring hidden rows, unlike AVERAGE which includes all rows.
Excel does not automatically identify summary rows in formulas.
Excel formulas cannot detect summary rows automatically; marking them manually in a helper column and using SUMIF is the reliable method.