Pivot table - group and sum specified columns from a single "columns" field

hairyfingers

New Member
Joined
Sep 10, 2015
Messages
9
Hi

If I have this table:

NameType
amount
fooRed
2​
barRed
4​
fizBlue
3​
buzBlue
5​
fooOrange
1​
barOrange
3​
fizGreen
5​
buzGreen
3​


I can produce this pivot table

Sum of amountColumn Labels
Row Labels
Blue
Green
Orange
Red
Grand Total
bar
3​
4​
7​
buz
5​
3​
8​
fiz
3​
5​
8​
foo
1​
2​
3​
Grand Total
8​
8​
4​
6​
26​


But what I want to do is produce a pivot table that looks like this:

sum of blue & green​
sum of orange & red​
Total​
bar
0​
7​
7​
buz
8​
0​
8​
fiz
8​
0​
8​
foo
0​
3​
3​
Grand Total
16​
10​
26​

So I need some sort of calculated field that calculates from a single column of the source data

Is this possible??

my actual data set as 392000 rows and 43 columns and I'm using Excel 2013
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

GraH

Well-known Member
Joined
Mar 22, 2020
Messages
708
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi,

This you can do with a simple grouping. Simply select "Green and Blue" columns, then via the mouse right click use "Group". Then rename this in the pivot. Repeat for the original Orange and Red labels. Finally remove "Type" from the pivot and leave "Type2", which is the grouping you made.
1586015144387.png

1586015281849.png
 

Watch MrExcel Video

Forum statistics

Threads
1,129,384
Messages
5,635,985
Members
416,891
Latest member
Okomomo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top