I would like to apply two nested sub-totals to a table in Excel 2007, but I find that the "SubTotal" button does not seem to work consistently.
Imagine the following table
Year Colour Amount
2011 Red 10
2011 Green 20
If I select all the rows and click on "SubTotal" with the following parameters
- At each change in - Year
- Use Function - Sum
- Add subtotal to - Amount
- Replace current subtotals - No
- Page break between groups - No
- Summary below data - No
I then do exactly the same but - At each change in - Colour
I get the following nice table which is exactly what I want
Year Colour Amount
Grand Total 30
2011 Total 30
Red Total 10
2011 Red 10
Green Total 20
2011 Green 20
Imagine though that I change "Green" to "Red" in the original table
Year Colour Amount
2011 Red 10
2011 Red 20
If I follow the above steps, then I would expect to see the table looking in the same format. However I get the following
Year Colour Amount
Red Total 30
Grand Total 30
2011 Total 30
2011 Red 10
2011 Red 20
As you can see the Red Total is at the top whereas I would like it to be after the row "2011 Total" just as it is in the first table.
Is there any way of working around this. [I know I can do this manually, but would like to use the SubTotal button]
To summarize, I need both the 2011 and the Colour to be sub-totaled, but in a way that first the 2011 is sub-totaled, and then the Colour (as in the first table I show above). This needs to work whatever the data that makes up the table. For me, it only works with the first data set, but not the second data set.
QUESTION UPDATED
Here is an example. The example includes an extra ten "Price" columns not mentioned in the problem. The reason why I have shown these ten columns is to show why PivotTables are not my ideal solution. I did not think it is possible with PivotTables to show the "details" of the rows inline with the subtotals - in the manner depicted in the picture.