vlookup formula to shows 2nd , 3rd, 4th result for same arrey value.

Amit Desai

New Member
Joined
Mar 21, 2020
Messages
16
Office Version
  1. 2013
Platform
  1. Windows
Namste🙏,

i have table of data where one product code have multiple values. is there any way to lookup for all the available values in column. VLOOKUP is bringing only first match value. for your ready reference i am giving you sample data. if some expert can help me to get my desired result i will be very thankful. ( should support office version 2016 and above )

Book11.xlsx
ABCDEFGHIJ
1Item CodeUnitDATEM/CShiftC&AOK CountRej Countvlookup formulaexpected result
21102001059P-145447775TA775T110200105900775T1102001059
31102001059P-145447775TB775T110200105900775T1102001059
41102000332P-145447660T.1A660T.111020003322483660T.11102000332
51102000332P-145447660T.1B660T.111020003323210660T.11102000332
61102001433P-145447660T.2A660T.211020014338312660T.21102001433
71102000690P-145447660T.2A1660T.211020006908611660T.21102000690
81102000690P-145447660T.2B660T.211020006905232660T.21102000690
91102000039P-145447450T.1A450T.11102000039982450T.11102000039
101102000039P-145447450T.1B450T.111020000391280450T.11102000039
111102000363P-145447350T.1A350T.111020003632362350T.11102000363
121102000363P-145447350T.1B350T.111020003633442350T.11102000363
131102001440P-145447350T.2A350T.2110200144080658350T.21102001440
141102001440P-145447350T.2B350T.21102001440124050350T.21102001440
151102001284P-145447350T.3A350T.311020012844456216350T.31102001284350T.31102001284
161102001284P-145447350T.2B350T.211020012848090174350T.31102001284350T.21102001284
171102001284P-145447350T.4B350T.411020012845230250350T.31102001284350T.41102001284
181102001037P-145447250T.1A250T.1110200103727812570250T.11102001037
191102001037P-145447250T.1B250T.1110200103739254168250T.11102001037
201102001287P-145447250T.4A250T.41102001287719949250T.41102001287
Sheet3
Cell Formulas
RangeFormula
I2:I20I2=VLOOKUP(A2,$A$2:$F$52,6,0)
 

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)
The simple way is to add two helper column, which has the number of times for which an entry is appearing and concatenating the original entry with this number

Please find below

As the looking happens to the left, INDEX/MATCH would have to be used

Please do let know whether this works

Book7
ABCDEFGHIJKL
1Item CodeUnitDATEM/CShiftC&AOK CountRej CountCount of Item CodeConcatIndex/Match formulaexpected result
21102001059P-145447775TA775T11020010590011102001059-1775T1102001059
31102001059P-145447775TB775T11020010590021102001059-2775T1102001059
41102000332P-145447660T.1A660T.11102000332248311102000332-1660T.11102000332
51102000332P-145447660T.1B660T.11102000332321021102000332-2660T.11102000332
61102001433P-145447660T.2A660T.21102001433831211102001433-1660T.21102001433
71102000690P-145447660T.2A1660T.21102000690861111102000690-1660T.21102000690
81102000690P-145447660T.2B660T.21102000690523221102000690-2660T.21102000690
91102000039P-145447450T.1A450T.1110200003998211102000039-1450T.11102000039
101102000039P-145447450T.1B450T.11102000039128021102000039-2450T.11102000039
111102000363P-145447350T.1A350T.11102000363236211102000363-1350T.11102000363
121102000363P-145447350T.1B350T.11102000363344221102000363-2350T.11102000363
131102001440P-145447350T.2A350T.211020014408065811102001440-1350T.21102001440
141102001440P-145447350T.2B350T.2110200144012405021102001440-2350T.21102001440
151102001284P-145447350T.3A350T.31102001284445621611102001284-1350T.31102001284350T.31102001284
161102001284P-145447350T.2B350T.21102001284809017421102001284-2350T.21102001284350T.21102001284
171102001284P-145447350T.4B350T.41102001284523025031102001284-3350T.41102001284350T.41102001284
Sheet2
Cell Formulas
RangeFormula
I2:I17I2=COUNTIF(A$2:A2,A2)
J2:J17J2=A2&"-"&I2
K2:K17K2=INDEX($F$2:$F$17,MATCH(J2,$J$2:$J$17,0))
 
Upvote 0
Another option
Fluff.xlsm
ABCDEFGHI
1Item CodeUnitDATEM/CShiftC&AOK CountRej Countvlookup formula
21102001059P-145447775TA775T110200105900775T1102001059
31102001059P-145447775TB775T110200105900775T1102001059
41102000332P-145447660T.1A660T.111020003322483660T.11102000332
51102000332P-145447660T.1B660T.111020003323210660T.11102000332
61102001433P-145447660T.2A660T.211020014338312660T.21102001433
71102000690P-145447660T.2A1660T.211020006908611660T.21102000690
81102000690P-145447660T.2B660T.211020006905232660T.21102000690
91102000039P-145447450T.1A450T.11102000039982450T.11102000039
101102000039P-145447450T.1B450T.111020000391280450T.11102000039
111102000363P-145447350T.1A350T.111020003632362350T.11102000363
121102000363P-145447350T.1B350T.111020003633442350T.11102000363
131102001440P-145447350T.2A350T.2110200144080658350T.21102001440
141102001440P-145447350T.2B350T.21102001440124050350T.21102001440
151102001284P-145447350T.3A350T.311020012844456216350T.31102001284
161102001284P-145447350T.2B350T.211020012848090174350T.21102001284
171102001284P-145447350T.4B350T.411020012845230250350T.41102001284
181102001037P-145447250T.1A250T.1110200103727812570250T.11102001037
191102001037P-145447250T.1B250T.1110200103739254168250T.11102001037
201102001287P-145447250T.4A250T.41102001287719949250T.41102001287
Data
Cell Formulas
RangeFormula
I2:I20I2=INDEX(F:F,AGGREGATE(15,6,ROW($A$2:$A$100)/($A$2:$A$100=A2),COUNTIFS(A$2:A2,A2)))
 
Upvote 0
Have you tried a pivot table?
actually both the data is in different sheet. only common items is "Item Code" that's why i have use vlookup but it gives only first result in all common "Item Code"
 
Upvote 0
actually both the data is in different sheet. only common items is "Item Code" that's why i have use vlookup but it gives only first result in all common "Item Code"
Ok, another option.
Book1
ABCDEFGHI
1Item CodeUnitDATEM/CShiftC&AOK CountRej CountLookup Formula
21102001059P-145447775TA775T110200105900775T1102001059
31102001059P-145447775TB775T110200105900775T1102001059
41102000332P-145447660T.1A660T.111020003322483660T.11102000332
51102000332P-145447660T.1B660T.111020003323210660T.11102000332
61102001433P-145447660T.2A660T.211020014338312660T.21102001433
71102000690P-145447660T.2A1660T.211020006908611660T.21102000690
81102000690P-145447660T.2B660T.211020006905232660T.21102000690
91102000039P-145447450T.1A450T.11102000039982450T.11102000039
101102000039P-145447450T.1B450T.111020000391280450T.11102000039
111102000363P-145447350T.1A350T.111020003632362350T.11102000363
121102000363P-145447350T.1B350T.111020003633442350T.11102000363
131102001440P-145447350T.2A350T.2110200144080658350T.21102001440
141102001440P-145447350T.2B350T.21102001440124050350T.21102001440
151102001284P-145447350T.3A350T.311020012844456216350T.31102001284
161102001284P-145447350T.2B350T.211020012848090174350T.21102001284
171102001284P-145447350T.4B350T.411020012845230250350T.41102001284
181102001037P-145447250T.1A250T.1110200103727812570250T.11102001037
191102001037P-145447250T.1B250T.1110200103739254168250T.11102001037
201102001287P-145447250T.4A250T.41102001287719949250T.41102001287
Sheet2
Cell Formulas
RangeFormula
I2:I20I2=LOOKUP(2,1/($A$2:A2=A2),$F$2:F2)
 
Upvote 0
Another option
Fluff.xlsm
ABCDEFGHI
1Item CodeUnitDATEM/CShiftC&AOK CountRej Countvlookup formula
21102001059P-145447775TA775T110200105900775T1102001059
31102001059P-145447775TB775T110200105900775T1102001059
41102000332P-145447660T.1A660T.111020003322483660T.11102000332
51102000332P-145447660T.1B660T.111020003323210660T.11102000332
61102001433P-145447660T.2A660T.211020014338312660T.21102001433
71102000690P-145447660T.2A1660T.211020006908611660T.21102000690
81102000690P-145447660T.2B660T.211020006905232660T.21102000690
91102000039P-145447450T.1A450T.11102000039982450T.11102000039
101102000039P-145447450T.1B450T.111020000391280450T.11102000039
111102000363P-145447350T.1A350T.111020003632362350T.11102000363
121102000363P-145447350T.1B350T.111020003633442350T.11102000363
131102001440P-145447350T.2A350T.2110200144080658350T.21102001440
141102001440P-145447350T.2B350T.21102001440124050350T.21102001440
151102001284P-145447350T.3A350T.311020012844456216350T.31102001284
161102001284P-145447350T.2B350T.211020012848090174350T.21102001284
171102001284P-145447350T.4B350T.411020012845230250350T.41102001284
181102001037P-145447250T.1A250T.1110200103727812570250T.11102001037
191102001037P-145447250T.1B250T.1110200103739254168250T.11102001037
201102001287P-145447250T.4A250T.41102001287719949250T.41102001287
Data
Cell Formulas
RangeFormula
I2:I20I2=INDEX(F:F,AGGREGATE(15,6,ROW($A$2:$A$100)/($A$2:$A$100=A2),COUNTIFS(A$2:A2,A2)))
Thanks for your reply. the formula looks good but what if the "F" column data is actually resides in another sheet name "DPR_Link-DT" G column so what change i have to make to get the desired result?
i have changed your formula like this "=INDEX('DPR_Link-DT'!G:G,AGGREGATE(15,6,ROW($A$2:$A$5100)/($A$2:$A$5100=A414),COUNTIFS(A$2:A414,A414)))" but it didnt worked.
 
Upvote 0
Try
Excel Formula:
=INDEX('DPR_Link-DT'!G:G,AGGREGATE(15,6,ROW('DPR_Link-DT'!$A$2:$A$5100)/('DPR_Link-DT'!$A$2:$A$5100=A414),COUNTIFS('DPR_Link-DT'!A$2:A,A2)))
 
Upvote 0
Ok, another option.
Book1
ABCDEFGHI
1Item CodeUnitDATEM/CShiftC&AOK CountRej CountLookup Formula
21102001059P-145447775TA775T110200105900775T1102001059
31102001059P-145447775TB775T110200105900775T1102001059
41102000332P-145447660T.1A660T.111020003322483660T.11102000332
51102000332P-145447660T.1B660T.111020003323210660T.11102000332
61102001433P-145447660T.2A660T.211020014338312660T.21102001433
71102000690P-145447660T.2A1660T.211020006908611660T.21102000690
81102000690P-145447660T.2B660T.211020006905232660T.21102000690
91102000039P-145447450T.1A450T.11102000039982450T.11102000039
101102000039P-145447450T.1B450T.111020000391280450T.11102000039
111102000363P-145447350T.1A350T.111020003632362350T.11102000363
121102000363P-145447350T.1B350T.111020003633442350T.11102000363
131102001440P-145447350T.2A350T.2110200144080658350T.21102001440
141102001440P-145447350T.2B350T.21102001440124050350T.21102001440
151102001284P-145447350T.3A350T.311020012844456216350T.31102001284
161102001284P-145447350T.2B350T.211020012848090174350T.21102001284
171102001284P-145447350T.4B350T.411020012845230250350T.41102001284
181102001037P-145447250T.1A250T.1110200103727812570250T.11102001037
191102001037P-145447250T.1B250T.1110200103739254168250T.11102001037
201102001287P-145447250T.4A250T.41102001287719949250T.41102001287
Sheet2
Cell Formulas
RangeFormula
I2:I20I2=LOOKUP(2,1/($A$2:A2=A2),$F$2:F2)
sorry didnt worked , i have changed formula as "=LOOKUP(2,1/($A$2:A414=A414),'DPR_Link-DT'!$G$2:G414)" ( this formula i have written 414 nos row ) so cell refrence showing "A414"
 
Upvote 0
Try
Excel Formula:
=INDEX('DPR_Link-DT'!G:G,AGGREGATE(15,6,ROW('DPR_Link-DT'!$A$2:$A$5100)/('DPR_Link-DT'!$A$2:$A$5100=A414),COUNTIFS('DPR_Link-DT'!A$2:A,A2)))
giving name error

Material Reco-Jun-24 (Plant-1) -04.06.2024 (2).xlsx
LMNOPQ
1Product_MatchedUnitDATEM/CShiftMC+SFG
4141102000039P-145447450T.1A#NAME?
4151102000039P-145447450T.1A#NAME?
BOM_Amit-DND
Cell Formulas
RangeFormula
L414:L415L414=IFERROR(VLOOKUP($A414,'DPR_Link-DT'!$A$2:$O$995,1,0),"")
M414:M415M414=IFERROR(VLOOKUP($A414,'DPR_Link-DT'!$A$2:$O$995,3,0),"")
N414:N415N414=IFERROR(VLOOKUP($A414,'DPR_Link-DT'!$A$2:$O$995,4,0),"")
O414:O415O414=IFERROR(VLOOKUP($A414,'DPR_Link-DT'!$A$2:$O$995,5,0),"")
P414:P415P414=IFERROR(VLOOKUP($A414,'DPR_Link-DT'!$A$2:$O$995,6,0),"")
Q414:Q415Q414=INDEX('DPR_Link-DT'!G:G,AGGREGATE(15,6,ROW('DPR_Link-DT'!$A$2:$A$5100)/('DPR_Link-DT'!$A$2:$A$5100=A414),COUNTIFS('DPR_Link-DT'!A$2:A,A5414)))
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,180
Members
452,615
Latest member
bogeys2birdies

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