VLookUp on multiple Rows with the same Value

memuench

New Member
Joined
Jan 19, 2018
Messages
4
Hello,
I am having Problems implement a VLookUp Function. I can't post the actual worksheet since it is confidential Company documents so I'll try to make a example here.

I got a Pivottable in Sheet 1 looking like this:

Col 1 Col 2 Col 3
ABB Development 5
ABB Product Support 10
ABB Beta Testing 15

Then I got a second Table in Sheet 2 looking like this:
Development Product Support Beta Testing
ABB


I think you already get the Point. I want the Values for the component ABB in the corresponding Category in Sheet 2. But here's the Problem: VLookUp will only search the first row with ABB. In Sheet 2 the Development Column always gets filled out with the correct number, but the rest doesn't since the Function obviously stops looking after finding the first row.

Anybody got an idea how to handle this?
Thanks
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Hi,

Take a look at the "GETPIVOTDATA function.
It will looks something like this:

See if this helps:


Book1
ABCD
6NameTypeSum of Total
7ABBBeta Testing15
8Development5
9Product Support10
10ABB Total30
11Grand Total30
12
13
14DevelopmentProduct SupportBeta Testing
15ABB51015
Sheet1
Cell Formulas
RangeFormula
B15=GETPIVOTDATA("Total",$A$6,"Name",$A15,"Type",B$14)
C15=GETPIVOTDATA("Total",$A$6,"Name",$A15,"Type",C$14)
D15=GETPIVOTDATA("Total",$A$6,"Name",$A15,"Type",D$14)
 
Last edited:
Upvote 0
Hi,

Take a look at the "GETPIVOTDATA function.
It will looks something like this:

See if this helps:

ABCD
NameTypeSum of Total
ABBBeta Testing
Development
Product Support
ABB Total
Grand Total
DevelopmentProduct SupportBeta Testing
ABB

<colgroup><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]6[/TD]

[TD="align: right"][/TD]

[TD="align: center"]7[/TD]

[TD="align: right"]15[/TD]
[TD="align: right"][/TD]

[TD="align: center"]8[/TD]
[TD="align: right"][/TD]

[TD="align: right"]5[/TD]
[TD="align: right"][/TD]

[TD="align: center"]9[/TD]
[TD="align: right"][/TD]

[TD="align: right"]10[/TD]
[TD="align: right"][/TD]

[TD="align: center"]10[/TD]

[TD="align: right"][/TD]
[TD="align: right"]30[/TD]
[TD="align: right"][/TD]

[TD="align: center"]11[/TD]

[TD="align: right"][/TD]
[TD="align: right"]30[/TD]
[TD="align: right"][/TD]

[TD="align: center"]12[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]13[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]14[/TD]
[TD="align: right"][/TD]

[TD="align: center"]15[/TD]

[TD="align: right"]5[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]15[/TD]

</tbody>
Sheet1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]B15[/TH]
[TD="align: left"]=GETPIVOTDATA("Total",$A$6,"Name",$A15,"Type",B$14)[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]C15[/TH]
[TD="align: left"]=GETPIVOTDATA("Total",$A$6,"Name",$A15,"Type",C$14)[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]D15[/TH]
[TD="align: left"]=GETPIVOTDATA("Total",$A$6,"Name",$A15,"Type",D$14)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]

I got a #REF Error. I used the following function:

=GETPIVOTDATA("Total";'[test.xlsx]testsheet'!$G$10;"Applic. area";A12709;"ProcOrg Cluster";"Product Support")

whereas Applic. Area is the Name in our example and A12709 the cell of the Name. ProcOrg Cluster is the Type and "Product Support" the word we are searching for
 
Upvote 0
Hi,

Means there's something wrong with the filled in fields and without looking at your file, i can't determine what.
I've linked my test model, take a look at my test model perhaps it helps you sort out what was wrong.
 
Last edited:
Upvote 0
Hi,

Means there's something wrong with the filled in fields and without looking at your file, i can't determine what.
I've linked my test model, take a look at my test model perhaps it helps you sort out what was wrong.

Hi Joris, I got it to work thanks to your formula.
Another question, I'm having a similar Problem now when wanting to extract data from a regular table (not a pivottable!). Is there a similar formula to what you posted since I can't use VLookUp (same values in rows again)

Thanks and BR
 
Upvote 0
Hi,

No there's no similar function to do so but there are more options than just using VLOOKUP.
If you can share a sample table and explain what your looking for. we can come up with a suitable solution for that as well.
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,906
Members
452,366
Latest member
TePunaBloke

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