Having Trouble with VLOOKUP where Multiple Rows of Data Have Value VLOOKUP Is Referencing

Aimee S.

Board Regular
Joined
Sep 28, 2010
Messages
236
Office Version
  1. 365
Platform
  1. Windows
Happy Friday Folks.

Any ideas? I have data (as an example) that looks like this:

[TABLE="width: 826"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD] Cust. # [/TD]
[TD][/TD]
[TD]SVC[/TD]
[/TR]
[TR]
[TD="align: right"]2400001[/TD]
[TD] [/TD]
[TD]KSBAS[/TD]
[/TR]
[TR]
[TD="align: right"]2400001[/TD]
[TD] [/TD]
[TD]K2B10[/TD]
[/TR]
[TR]
[TD="align: right"]2400001[/TD]
[TD] [/TD]
[TD]K2RES[/TD]
[/TR]
[TR]
[TD="align: right"]2400001[/TD]
[TD] [/TD]
[TD]K2TPD[/TD]
[/TR]
</tbody>[/TABLE]

On another sheet I am trying to figure out how to make it look like this in a single row:

Cust.[TABLE="width: 455"]
<colgroup><col><col><col><col><col></colgroup><tbody>[TR]
[TD] #[/TD]
[TD] SVC 1[/TD]
[TD]SVC 2[/TD]
[TD]SVC 3[/TD]
[TD]SVC 4[/TD]
[/TR]
[TR]
[TD]2400001 [/TD]
[TD] KSBAS[/TD]
[TD]K2B10[/TD]
[TD]K2RES[/TD]
[TD]K2TPD[/TD]
[/TR]
</tbody>[/TABLE]

Such that the formulas in SVC 1 SVC 2 SVC 3 SVC 4 etc. know to pull in the value "KSBAS" into the SVC 1 column since it is the first value to appear in the SVC column on the source sheet for that customer # 2400001, and have the subsequent SVC 2 SVC 3 and SVC 4 etc columns know to continue to pull in the next SVC value that appears for that customer # on the source sheet until the customer ID changes.

Any help is appreciated! I am guessing INDEX may have something to do with it but I am sorely inexperienced with INDEX related formulas. :(
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
maybe something like,,,,

Unknown[TABLE="class: grid, width: 400"]
<tbody>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] "]Cust. #[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"][/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] "]SVC[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"]2400001[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"][/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] "]KSBAS[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"]2400001[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"][/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] "]K2B10[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"]2400001[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"][/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] "]K2RES[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"]2400001[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"][/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] "]K2TPD[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: center"]7[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FAFAFA]#FAFAFA[/URL] , align: right"]2400001[/TD]
[TD]KSBAS[/TD]
[TD]K2B10[/TD]
[TD]K2RES[/TD]
[TD]K2TPD[/TD]
[/TR]
</tbody>[/TABLE]
Sheet2

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Array Formulas[TABLE="width: 100%"]
<tbody>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
[TR]
[TH="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]B7[/TH]
[TD="align: left"]{=IFERROR(INDEX($C$2:$C$5,SMALL(IF($A$2:$A$5=$A7,ROW($A$2:$A$5)-ROW($A$2)+1),COLUMNS($A7:A7))),"")}[/TD]
[/TR]
</tbody>[/TABLE]
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
I think this is very close. It isn't working (erroring out) but that is probably because I am not applying correctly.

=IFERROR(INDEX('Customer Services'!$C$2:$C$2000,SMALL(IF('Customer Services'!$A$2:$A$2000=$A3,ROW('Customer Services'!$A$2:$A$2000)-ROW('Customer Services'!$A$2)+1),COLUMNS($A3:A3))),"") with CTRL SHFT ENTER

I uploaded images of the source and target worksheets

https://imgur.com/IjRg2tT

https://imgur.com/NcqbVjT

The cells highlighted in red on the Dashboard worksheet are where the formulas will live, and the worksheet entitled Customer Services is where the data is being pulled from.:( Thanks for your help!!










maybe something like,,,,

Unknown[TABLE="class: grid, width: 400"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[/TR]
[TR]
[TD="align: center"]1
[/TD]
[TD]Cust. #
[/TD]
[TD="align: right"][/TD]
[TD]SVC
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: center"]2
[/TD]
[TD="align: right"]2400001
[/TD]
[TD="align: right"][/TD]
[TD]KSBAS
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: center"]3
[/TD]
[TD="align: right"]2400001
[/TD]
[TD="align: right"][/TD]
[TD]K2B10
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: center"]4
[/TD]
[TD="align: right"]2400001
[/TD]
[TD="align: right"][/TD]
[TD]K2RES
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: center"]5
[/TD]
[TD="align: right"]2400001
[/TD]
[TD="align: right"][/TD]
[TD]K2TPD
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: center"]6
[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD="align: center"]7
[/TD]
[TD="align: right"]2400001
[/TD]
[TD]KSBAS
[/TD]
[TD]K2B10
[/TD]
[TD]K2RES
[/TD]
[TD]K2TPD
[/TD]
[/TR]
</tbody>[/TABLE]
Sheet2

[TABLE="width: 85%"]
<tbody>[TR]
[TD]
Array Formulas[TABLE="width: 100%"]
<tbody>[TR]
[TH]Cell
[/TH]
[TH="align: left"]Formula
[/TH]
[/TR]
[TR]
[TH]B7
[/TH]
[TD="align: left"]{=IFERROR(INDEX($C$2:$C$5,SMALL(IF($A$2:$A$5=$A7,ROW($A$2:$A$5)-ROW($A$2)+1),COLUMNS($A7:A7))),"")}
[/TD]
[/TR]
</tbody>[/TABLE]
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,223,912
Messages
6,175,340
Members
452,638
Latest member
Oluwabukunmi

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