Vlookup (or match&Index) in Pivot Table

MartinL

Well-known Member
Joined
Oct 16, 2008
Messages
1,141
Office Version
  1. 365
Platform
  1. Windows
I have seen questions about this in various places but I cant see an answer to my ordeal.

Am I right in thinking that "PivotTable1" is not a valid table_array name.

My Pivot table by definition is dynamic so I can not fix the range

anyway here is what I am trying to do:

On the left is my pivot table (PivotTable1)
I want to take this info and recreate it on the right adding some additional info about the values

For example Retailer 1 has a total of 303 promotions over a period
divided up between 5 different types of promotion
Money off, for example represents 25.08% of total promotions for that retailer (Retailer1 in this case)

If a retailer has no offers during the selected period, the row will dissapear from pivot table
If a Retailer8 (not shown) has a promotion it will appear in the pivot Table
If no retailer has any BOGOFF promotions that column will dissapaer etc

My attempts so far have revolved around this, to no avail:
In Cell L3
Code:
=VLOOKUP(K3,pivottable1,2)
Excel Workbook
ABCDEFGHIJKLMNOPQ
1Count of Promotion TypeColumn Labels
2Row LabelsBOGOFFExtra FreeLink SaveMoney OffOtherGrand TotalBOGOFFExtra FreeLink SaveMoney OffOtherGrand Total
3Retailer122776303Retailer122776303
4Retailer21511814241710.00%0.00%74.92%25.08%0.00%
5Retailer3104183221220
6Retailer465977142Retailer2151181424171
7Retailer595351300.00%8.77%69.01%8.19%14.04%
8Retailer6552257521331
9Retailer7312323149Retailer3104183221220
10Grand Total153310303224614464.55%1.82%83.18%10.00%0.45%
11
12Retailer465977142
130.00%4.23%41.55%54.23%0.00%
14
15Retailer59535130
160.00%0.00%73.08%26.92%0.00%
17
18Retailer6552257521331
191.51%1.51%67.98%22.66%6.34%
20
21Retailer7312323149
220.00%2.01%82.55%15.44%0.00%
Sheet2
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Just add your item of Count Of Promotion Type again, and have that one have Field Settings of Show Values as % of row. And pull your pivottable items to be the same shape as you require.
 
Upvote 0
Like so:
Excel Workbook
DEFGHIJK
1Promotion Type
2NameDataBOGOFFExtra FreeLink SaveMoney OffOtherGrand Total
3Retailer1Count866929
4%0.00%27.59%20.69%20.69%31.03%100.00%
5Retailer2Count957829
6%0.00%31.03%17.24%24.14%27.59%100.00%
7Retailer3Count4771129
8%0.00%13.79%24.14%24.14%37.93%100.00%
9Retailer4Count7371027
10%0.00%25.93%11.11%25.93%37.04%100.00%
11Retailer5Count5761028
12%0.00%17.86%25.00%21.43%35.71%100.00%
13Retailer6Count335617
14%0.00%17.65%17.65%29.41%35.29%100.00%
15Retailer7Count767929
16%0.00%24.14%20.69%24.14%31.03%100.00%
17Total Count43374563188
18Total %0.00%22.87%19.68%23.94%33.51%100.00%
Sheet3
 
Upvote 0
Thanks Glenn

I cant get mine to look like yours, rather side by side.

Overview

<TABLE style="BACKGROUND-COLOR: #ffffff; PADDING-LEFT: 2pt; PADDING-RIGHT: 2pt; FONT-FAMILY: Calibri,Arial; FONT-SIZE: 11pt" border=1 cellSpacing=0 cellPadding=0><COLGROUP><COL style="WIDTH: 30px; FONT-WEIGHT: bold"><COL style="WIDTH: 92px"><COL style="WIDTH: 148px"><COL style="WIDTH: 69px"><COL style="WIDTH: 64px"><COL style="WIDTH: 73px"><COL style="WIDTH: 122px"><COL style="WIDTH: 69px"><COL style="WIDTH: 64px"><COL style="WIDTH: 73px"><COL style="WIDTH: 184px"><COL style="WIDTH: 157px"></COLGROUP><TBODY><TR style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt; FONT-WEIGHT: bold"><TD> </TD><TD>A</TD><TD>B</TD><TD>C</TD><TD>D</TD><TD>E</TD><TD>F</TD><TD>G</TD><TD>H</TD><TD>I</TD><TD>J</TD><TD>K</TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">1</TD><TD>Date</TD><TD>(Multiple Items)</TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">2</TD><TD>Sector</TD><TD>Prepared</TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">3</TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">4</TD><TD> </TD><TD>Column Labels</TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">5</TD><TD> </TD><TD>Count Promotion Type</TD><TD> </TD><TD> </TD><TD> </TD><TD>% Promotion Type</TD><TD> </TD><TD> </TD><TD> </TD><TD style="TEXT-ALIGN: center">Total Count Promotion Type</TD><TD style="TEXT-ALIGN: center">Total % Promotion Type</TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">6</TD><TD>Row Labels</TD><TD style="TEXT-ALIGN: center">BOGOFF</TD><TD style="TEXT-ALIGN: center">Extra Free</TD><TD style="TEXT-ALIGN: center">Link Save</TD><TD style="TEXT-ALIGN: center">Money Off</TD><TD style="TEXT-ALIGN: center">BOGOFF</TD><TD style="TEXT-ALIGN: center">Extra Free</TD><TD style="TEXT-ALIGN: center">Link Save</TD><TD style="TEXT-ALIGN: center">Money Off</TD><TD> </TD><TD> </TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">7</TD><TD style="TEXT-ALIGN: left">Ret1</TD><TD> </TD><TD> </TD><TD style="TEXT-ALIGN: center">176</TD><TD style="TEXT-ALIGN: center">21</TD><TD style="TEXT-ALIGN: center">0.00%</TD><TD style="TEXT-ALIGN: center">0.00%</TD><TD style="TEXT-ALIGN: center">89.34%</TD><TD style="TEXT-ALIGN: center">10.66%</TD><TD style="TEXT-ALIGN: center">197</TD><TD style="TEXT-ALIGN: center">100.00%</TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">8</TD><TD style="TEXT-ALIGN: left">Ret2</TD><TD> </TD><TD style="TEXT-ALIGN: center">4</TD><TD style="TEXT-ALIGN: center">92</TD><TD style="TEXT-ALIGN: center">12</TD><TD style="TEXT-ALIGN: center">0.00%</TD><TD style="TEXT-ALIGN: center">3.70%</TD><TD style="TEXT-ALIGN: center">85.19%</TD><TD style="TEXT-ALIGN: center">11.11%</TD><TD style="TEXT-ALIGN: center">108</TD><TD style="TEXT-ALIGN: center">100.00%</TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">9</TD><TD style="TEXT-ALIGN: left">Ret3</TD><TD> </TD><TD style="TEXT-ALIGN: center">4</TD><TD style="TEXT-ALIGN: center">9</TD><TD style="TEXT-ALIGN: center">28</TD><TD style="TEXT-ALIGN: center">0.00%</TD><TD style="TEXT-ALIGN: center">9.76%</TD><TD style="TEXT-ALIGN: center">21.95%</TD><TD style="TEXT-ALIGN: center">68.29%</TD><TD style="TEXT-ALIGN: center">41</TD><TD style="TEXT-ALIGN: center">100.00%</TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">10</TD><TD style="TEXT-ALIGN: left">Ret4</TD><TD> </TD><TD> </TD><TD style="TEXT-ALIGN: center">31</TD><TD style="TEXT-ALIGN: center">11</TD><TD style="TEXT-ALIGN: center">0.00%</TD><TD style="TEXT-ALIGN: center">0.00%</TD><TD style="TEXT-ALIGN: center">73.81%</TD><TD style="TEXT-ALIGN: center">26.19%</TD><TD style="TEXT-ALIGN: center">42</TD><TD style="TEXT-ALIGN: center">100.00%</TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">11</TD><TD style="TEXT-ALIGN: left">Ret5</TD><TD style="TEXT-ALIGN: center">5</TD><TD style="TEXT-ALIGN: center">3</TD><TD style="TEXT-ALIGN: center">81</TD><TD style="TEXT-ALIGN: center">10</TD><TD style="TEXT-ALIGN: center">5.05%</TD><TD style="TEXT-ALIGN: center">3.03%</TD><TD style="TEXT-ALIGN: center">81.82%</TD><TD style="TEXT-ALIGN: center">10.10%</TD><TD style="TEXT-ALIGN: center">99</TD><TD style="TEXT-ALIGN: center">100.00%</TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">12</TD><TD style="TEXT-ALIGN: left">Ret6</TD><TD> </TD><TD> </TD><TD style="TEXT-ALIGN: center">67</TD><TD style="TEXT-ALIGN: center">2</TD><TD style="TEXT-ALIGN: center">0.00%</TD><TD style="TEXT-ALIGN: center">0.00%</TD><TD style="TEXT-ALIGN: center">97.10%</TD><TD style="TEXT-ALIGN: center">2.90%</TD><TD style="TEXT-ALIGN: center">69</TD><TD style="TEXT-ALIGN: center">100.00%</TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">13</TD><TD style="TEXT-ALIGN: left">Grand Total</TD><TD style="TEXT-ALIGN: center">5</TD><TD style="TEXT-ALIGN: center">11</TD><TD style="TEXT-ALIGN: center">456</TD><TD style="TEXT-ALIGN: center">84</TD><TD style="TEXT-ALIGN: center">0.90%</TD><TD style="TEXT-ALIGN: center">1.98%</TD><TD style="TEXT-ALIGN: center">82.01%</TD><TD style="TEXT-ALIGN: center">15.11%</TD><TD style="TEXT-ALIGN: center">556</TD><TD style="TEXT-ALIGN: center">100.00%</TD></TR></TBODY></TABLE>

Excel tables to the web >> http://www.excel-jeanie-html.de/index.php?f=1" target="_blank"> Excel Jeanie HTML 4
 
Upvote 0
It's hard to describe, but I pulled the Column Label part into the Row Label area.
 
Upvote 0

Forum statistics

Threads
1,224,592
Messages
6,179,789
Members
452,942
Latest member
VijayNewtoExcel

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