Extract Data from a Pivotable

pjmorris

Well-known Member
Joined
Aug 2, 2012
Messages
2,172
Office Version
  1. 365
Platform
  1. Windows
Dear All,

Having tried to do this with GETPIVOTDATA I now believe that that function only extracts totals and subtotals. I'm trying to extract the heirarchical data and I wonder if this is possible (I suppose I could go back to the original data, but I want to know if I can extract it from the pivot).

The source data is as follows:

[TABLE="class: grid, width: 272"]
<tbody>[TR]
[TD="width: 68"]company[/TD]
[TD="width: 68"]unit[/TD]
[TD="width: 68"]name[/TD]
[TD="width: 68"]worker[/TD]
[/TR]
[TR]
[TD]Company[/TD]
[TD]AA[/TD]
[TD]Harry[/TD]
[TD]Buggins[/TD]
[/TR]
[TR]
[TD]Company[/TD]
[TD]AA[/TD]
[TD]Harry[/TD]
[TD]Arold[/TD]
[/TR]
[TR]
[TD]Shop[/TD]
[TD]NN[/TD]
[TD]Julie[/TD]
[TD]Ken[/TD]
[/TR]
[TR]
[TD]Shop[/TD]
[TD]NN[/TD]
[TD]Julie[/TD]
[TD]Lora[/TD]
[/TR]
[TR]
[TD]Company[/TD]
[TD]CC[/TD]
[TD]Martin[/TD]
[TD]Nick[/TD]
[/TR]
[TR]
[TD]Company[/TD]
[TD]AA[/TD]
[TD]Harry[/TD]
[TD]Cooper[/TD]
[/TR]
[TR]
[TD]Company[/TD]
[TD]AA[/TD]
[TD]Harry[/TD]
[TD]Denis[/TD]
[/TR]
[TR]
[TD]Company[/TD]
[TD]BB[/TD]
[TD]Ian[/TD]
[TD]Eric[/TD]
[/TR]
[TR]
[TD]Company[/TD]
[TD]AA[/TD]
[TD]Harry[/TD]
[TD]Frank[/TD]
[/TR]
[TR]
[TD]Company[/TD]
[TD]BB[/TD]
[TD]Ian[/TD]
[TD]Gertrude[/TD]
[/TR]
</tbody>[/TABLE]


The Pivot Table output looks like this:

[TABLE="class: grid, width: 383"]
<tbody>[TR]
[TD]company[/TD]
[TD]unit[/TD]
[TD]name[/TD]
[TD]worker[/TD]
[/TR]
[TR]
[TD]Company[/TD]
[TD]AA[/TD]
[TD]Harry[/TD]
[TD]Arold[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Buggins[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Cooper[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Denis[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Frank[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]BB[/TD]
[TD]Ian[/TD]
[TD]Eric[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Gertrude[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]CC[/TD]
[TD]Martin[/TD]
[TD]Nick[/TD]
[/TR]
[TR]
[TD]Shop[/TD]
[TD]NN[/TD]
[TD]Julie[/TD]
[TD]Ken[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Lora[/TD]
[/TR]
</tbody>[/TABLE]


I would like to be able to refer to say 'Frank' and return that he works for the 'Company' company , in the 'AA' Unit, with a boss named 'Harry'. If I hover my mouse of the name Frank I get a popup that provides just that information, but I can't find a way of doing it either with code or a function; as noted above I cant make GETPIVOTDATA achieve this result.

Grateful for any advice.

Regards
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
When you repeat all itemlables you can use INDEX and MATCH to extract data from your Pivot Table.
 
Upvote 0
Hi Mart,

How simple! I assumed I could do it, just didn't know how.

Many thanks, much appreciated.

Regards

Peter
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,304
Members
452,633
Latest member
DougMo

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
Back
Top