2.2 Combining Multiple Subtotals to One Row
When applying multiple function types, Excel places
each subtotal on its own row. There is no built-in option to have the
subtotals appear on the same row. But you can manipulate Excel to make
this happen by applying a subtotal to a column where you don’t want it,
and then manually changing the formula.
Portraying Multiple Function Types on a Single Row
To have multiple function types appear on a single row, as shown in Figure 2, follow these steps:
1. | Sort the data by the column the summary should be based off of. For example, if summarizing by region, sort the Region column.
|
2. | Select a cell in the dataset.
|
3. | Go to Data, Outline, Subtotal.
|
4. | From the At Each Change In field, select the column by which to summarize the data.
|
5. | From the Use Function field, select the function to calculate the totals by.
|
6. | From
the Add Subtotal To field, select the columns the totals should be
added to. Also select the column where you want to apply the second
function type, like the Customer column selected in Figure 3.
|
7. | Click OK.
|
8. | Collapse the dataset by clicking the “2” outline symbol so only the total rows are visible.
|
9. | Select the data in the column where the second function type should be.
|
10. | Go to Home, Editing, Find & Select, Go to Special, and select Visible Cells Only.
|
11. | Go to Home, Editing, Find & Select, Replace.
|
12. | In the Find What field, type “SUBTOTAL(9,”.
|
13. | In the Replace With field, type the subtotal function using the desired function number. For example, in Figure 4, “SUBTOTAL(2,” will replace the SUM function with the COUNTA function.
|
14. | Click Replace All.
|
15. | Click OK to close the Excel notification of the number of replacements made.
|
16. | Click Close. If needed, apply any required formatting to the selected cells.
|