Get pivot row header name if text matches

123excel

New Member
Joined
Jan 18, 2017
Messages
34
Hi, I need to get a pivot row header name to another cell if another cell matches.

DETAILED EXPLANATION:
Se example of pivot table below.

I have two sheets, lets call them "data" (sheet with pivot table) and "result" (without pivot table). If any text in C:C (in "result") matches any of the text in "data" pivot table (B:B), I want it to get the Row header name in the cell at the right. Lets say C3 matches Text 5, then in D3 I want it to say "ROW HEADER 2".

------------PIVOT TABLE------------
[TABLE="width: 317"]
<colgroup><col></colgroup><tbody>[TR]
[TD]+ROW HEADER[/TD]
[/TR]
[TR]
[TD]Text 1[/TD]
[/TR]
[TR]
[TD]Text 2[/TD]
[/TR]
[TR]
[TD]Text 3[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]+ROW HEADER 2[/TD]
[/TR]
[TR]
[TD]Text 4[/TD]
[/TR]
[TR]
[TD]Text 5[/TD]
[/TR]
[TR]
[TD]Text 6
-----------PIVOT TABLE-----------[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Hi, I need to get a pivot row header name to another cell if another cell matches.

DETAILED EXPLANATION:
Se example of pivot table below.

I have two sheets, lets call them "data" (sheet with pivot table) and "result" (without pivot table). If any text in C:C (in "result") matches any of the text in "data" pivot table (B:B), I want it to get the Row header name in the cell at the right. Lets say C3 matches Text 5, then in D3 I want it to say "ROW HEADER 2".

------------PIVOT TABLE------------
[TABLE="width: 317"]
<tbody>[TR]
[TD]+ROW HEADER[/TD]
[/TR]
[TR]
[TD]Text 1[/TD]
[/TR]
[TR]
[TD]Text 2[/TD]
[/TR]
[TR]
[TD]Text 3[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]+ROW HEADER 2[/TD]
[/TR]
[TR]
[TD]Text 4[/TD]
[/TR]
[TR]
[TD]Text 5[/TD]
[/TR]
[TR]
[TD]Text 6
-----------PIVOT TABLE-----------[/TD]
[/TR]
</tbody>[/TABLE]

easiest solution would be to change the layout of the pivot table to tabular form so you'll get 2 separate columns and toggle repeat all item labels.. this way, you can just use this formula to return the header:

=INDEX(Data!B:B,MATCH(C3,Data!C:C,0))
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,259
Members
452,626
Latest member
huntinghunter

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