Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel pivot-tables subtotals

I am trying to build a pivot table in Excel to summarize some data, like

enter image description here

I want columns A and B to be in compact form and column C to be outlined; also I need subtotals for the B column. Letting subtotals appear on the last row, everything works fine

enter image description here

But when I go to the B field contextual menu, select "Field Settings/Layout & Print" and select "Display subtotals at the top of each group" subtotals break down: some do not appear (for the "b/a" configuration) and some others give the wrong result (60 for the "a/a" combination).

enter image description here

Is there a way out of this? I am using Excel 2010 but tested the same file on Excel 2007 and the same issue seems to arise.

Any advice would be greatly appreciated.

like image 290
caseroR Avatar asked Sep 25 '12 13:09

caseroR


People also ask

Why does my PivotTable not show subtotals?

In a PivotTable, subtotals are calculated automatically and appear by default. Here's how to hide them: Click anywhere in the PivotTable to show the PivotTable Tools on the ribbon. Click Design > Subtotals, and then pick Do Not Show Subtotals.

What is the difference between PivotTable and subtotal?

In all versions of Excel, pivot tables are far more flexible than Data > Subtotal. You can Group Dates, write formulas, use slicers, create charts from pivot tables. Data > Subtotal only summarises data - essentially generates a series of SUMIF(), COUNTIF(), MAX IF etc.


1 Answers

Since you're not interested in subtotals for the first column (A), I suggest creating a separate column containing the concatenation of A and B, which then yield the desired result:

enter image description here

Unique combinations are grouped and totalled correctly.

like image 131
Werner Avatar answered Sep 28 '22 07:09

Werner