INDEX MATCH or VLOOKUP?

pvtjoker77

New Member
Joined
Aug 31, 2015
Messages
13
Office Version
  1. 2016
Platform
  1. Windows
I have been racking my brain on this one and can't find what I'm looking for to line up names and positions from one sheet to another and to add to the difficulty if there were duplicates with the same time and position that the 2nd entry for that time and position would go onto the TRN line of the position. (the highlighted one in the example below would go on the G2 TRN line)

So to set it up:

On Sheet1 I have a daily schedule lineup with times and positions to the corresponding cells to try and work with INDEX MATCH.

On Sheet2 I have the daily Start times, Positions, and Names that I would copy and paste from a downloadable csv file so the names and amount of positions are always changing.

Thank you in advance for any help!!

Book1
ABCDE
1TimePositionName
2Tue May 3, 2022
3DeskxxxExtension
40600 - 1430 Desk G1REG XXX East+0409
50600 - 1430 Desk G1REG XXX East TRN+0409
60600 - 1430 Desk G2REG XXX Central+0424
70600 - 1430 Desk G2REG XXX Central TRN+0424
8600 - 1430 Desk G3REG XXX West+0403
90600 - 1430 Desk G3REG XXX West TRN+0403
100600 - 1430 Desk G4XXX +0423
110600 - 1430 Desk G4XXX TRN+0423
120600 - 1430 Desk S1Sector 1+0416
130600 - 1430 Desk S1Sector 1 TRN+0416
140600 - 1430 Desk S2Sector 2+0417
150600 - 1430 Desk S2Sector 2 TRN+0417
160600 - 1430 Desk S3Sector 3+0418
170600 - 1430 Desk S3Sector 3 TRN+0418
180600 - 1430 Desk S4Sector 4+0419
190600 - 1430 Desk S4Sector 4 TRN+0419
200700 - 1530 Desk S5Sector 5+0420
210700 - 1530 Desk S5Sector 5 TRN+0420
220700 - 1530 Desk S6Sector 6+0421
230700 - 1530 Desk S6Sector 6 TRN+0421
240700 - 1530 Desk R1Router 1+0413
250700 - 1530 Desk R1Router 1 TRN+0413
260700 - 1530 Desk R2Router 2+0414
270700 - 1530 Desk R2Router 2 TRN+0414
28
29DeskxxxExtension
301400 - 2230 Desk G1REG xxx East+0409
311400 - 2230 Desk G1REG xxx East TRN+0409
321400 - 2230 Desk G2REG central+0424
331400 - 2230 Desk G2REG SOD Central TRN+0424
341400 - 2230 Desk G3REGxxx West+0403
351400 - 2230 Desk G3REG SOD West TRN+0403
361400 - 2230 Desk G4xxx+0423
371400 - 2230 Desk G4xxxTRN+0423
381400 - 2230 Desk S1Sector 1+0416
391400 - 2230 Desk S1Sector1 TRN+0416
401400 - 2230 Desk S2Sector 2+0417
411400 - 2230 Desk S2Sector 2 TRN+0417
Sheet1


Book1
ABC
1TimePositionName
20600 - 1430 Desk G1Marvin
31400 - 2230 Desk G1Kush
42200 - 0630 Desk G1 Chris
50600 - 1430 Desk G2Spencer
60600 - 1430 Desk G2Judd
71400 - 2230 Desk G2Leian
80600 - 1430 Desk G3David
91400 - 2230 Desk G3David
100600 - 1430 Desk G4Courtney
111400 - 2230 Desk G4Anthony
120700 - 1530 Desk R1Jeff
131500 - 2330 Desk R1Rick
140700 - 1530 Desk R2Luis
151500 - 2330 Desk R2Ryan
160600 - 1430 Desk S1Bill
171400 - 2230 Desk S1Cathy
182200 - 0630 Desk S1Cale
190600 - 1430 Desk S2Bruce
201400 - 2230 Desk S2Roger
212200 - 0630 Desk S2James
220600 - 1430 Desk S3Charles
231400 - 2230 Desk S3Todd
240600 - 1430 Desk S4John
251400 - 2230 Desk S4John
260700 - 1530 Desk S5Thom
271500 - 2330 Desk S5Lucas
280700 - 1530 Desk S6Paul
291500 - 2330 Desk S6Andrew
Sheet2
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Had the same issue recently. Resolved it with a nested vlookup to prove that i wasn't in the wrong (=iferror(vlookup(A1,*named range*,1,false),"no issue)) first to prove it and didn't pick up what was needed. Index match resolved it.


*name your ranges doing a vlookup to cut out human error
 
Upvote 0
Or you could hide multiple cells and use the trim(right/left) function then do the Vlookup? Although that would only be worth the time if you were using it a lot and creating a template.
 
Upvote 0
I have tried Helper columns of A&B and with IF & Vllokup but trying to take into account when there are not any Duplicates (someone Training) is what is tripping me up.
For example, in the above example cells, A5:B6 are currently duplicates but tomorrow the training person currently in A6:B6 is off tomorrow so cells A5:B5 will have 0600-1430 Desk G2 and Cells A6:B6 will have 1400-2230 Desk G2.

Thanks though :)
 
Upvote 0
I have even tried IF statements, and as I was going along, I realized that All the main Cells (the ones without TRN people associated next to them) all could be 1 cell off. Not that there would be 10 people training at once,This is because we could have up to 4 or 5 on any given day.

I have tried it with helpers and sorting. I have even added formulas for duplicates. This is because, If there are duplicates of the same time and position, the bottom one of the duplicates is the TRN person.

Just an FYI Sheet1 Columns A, B & G are just Helpers I made to try and figure this out.
Also Sheet2 the Highlighted rows are to sow the duplicates and that the 2nd person is the person Training (TRN)

Thanks in advance


Book1.xlsx
ABCDEFGH
1TimePositionName
2Tue May 3, 2022
3DeskxxxExtension
40600 - 1430 Desk G1REG XXX EastMarvin +04090600 - 1430 Desk G1
50600 - 1430 Desk G1REG XXX East TRN +04090600 - 1430 Desk G1
60600 - 1430 Desk G2REG XXX CentralSpencer +04240600 - 1430 Desk G2
70600 - 1430 Desk G2REG XXX Central TRNJudd +04240600 - 1430 Desk G2
80600 - 1430 Desk G3REG XXX WestDavid +04030600 - 1430 Desk G3
90600 - 1430 Desk G3REG XXX West TRN +04030600 - 1430 Desk G3
100600 - 1430 Desk G4XXX Courtney +04230600 - 1430 Desk G4
110600 - 1430 Desk G4XXX TRN +04230600 - 1430 Desk G4
120600 - 1430 Desk S1Sector 1+04160600 - 1430 Desk S1
130600 - 1430 Desk S1Sector 1 TRN+04160600 - 1430 Desk S1
140600 - 1430 Desk S2Sector 2+04170600 - 1430 Desk S2
150600 - 1430 Desk S2Sector 2 TRN+04170600 - 1430 Desk S2
Sheet1
Cell Formulas
RangeFormula
D4D4=Sheet2!D2
D5D5=IF(Sheet2!E3=2,Sheet2!D3,"")
D6,D8D6=IF(Sheet2!E3=1,Sheet2!D3,"")
D7,D9D7=IF(Sheet2!E4=2,Sheet2!D4,"")
D10D10=IF(Sheet2!E6=1,Sheet2!D6,"")
D11D11=IF(Sheet2!E7=2,Sheet2!D7,"")
G4:G15G4=A4&""&B4
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D4:D27Expression=FIND("TRN",C4:C61)textNO
C10Expression=$F$31="open"textNO
E10Expression=$F$31="open"textNO
E12Expression=$F$21="open"textNO
C6Expression=$F$17="open"textNO
C4Expression=$F$15="open"textNO
E4Expression=$F$15="open"textNO
E6Expression=$F$17="open"textNO
C8Expression=$F$19="open"textNO
C14Expression=$F$23="open"textNO
E14Expression=$F$23="open"textNO
E8Expression=$F$19="open"textNO
D4:D27Cell Valuecontains "open"textNO
C4:E4,D5:D27Cell Valuecontains "Open"textNO



Book1.xlsx
ABCDE
1TimePositionName
20600 - 1430 Desk G10600 - 1430 Desk G1Marvin
30600 - 1430 Desk G20600 - 1430 Desk G2Spencer 1
40600 - 1430 Desk G20600 - 1430 Desk G2Judd 2
50600 - 1430 Desk G30600 - 1430 Desk G3David 1
60600 - 1430 Desk G40600 - 1430 Desk G4Courtney 1
70600 - 1430 Desk S10600 - 1430 Desk S1Bill 1
80600 - 1430 Desk S20600 - 1430 Desk S2Bruce 1
90600 - 1430 Desk S30600 - 1430 Desk S3Charles 1
100600 - 1430 Desk S40600 - 1430 Desk S4John 1
110700 - 1530 Desk R10700 - 1530 Desk R1Jeff 1
120700 - 1530 Desk R20700 - 1530 Desk R2Luis 1
130700 - 1530 Desk S50700 - 1530 Desk S5Thom 1
140700 - 1530 Desk S60700 - 1530 Desk S6Paul 1
151400 - 2230 Desk G11400 - 2230 Desk G1Kush 1
Sheet2
Cell Formulas
RangeFormula
C2:C15C2=A2&""&B2
E3:E15E3=IF(D2>"",COUNTIF(C2:C3, C2),"")
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,901
Members
449,097
Latest member
dbomb1414

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