Index and match

RedOctoberKnight

Board Regular
Joined
Nov 16, 2015
Messages
152
Office Version
  1. 2016
Platform
  1. Windows
Good Morning,

I trying to use index and match to lookup and employee name based on the day of the week and their position.

for example, I want to return the employee name who is in position "1" on Thursday.

[TABLE="width: 485"]
<tbody>[TR]
[TD]Employee[/TD]
[TD]Sunday[/TD]
[TD]Monday[/TD]
[TD]Tuesday[/TD]
[TD]Wednesday[/TD]
[TD]Thursday[/TD]
[TD]Friday[/TD]
[TD]Saturday[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]OFF[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]1[/TD]
[TD]OFF[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]OFF[/TD]
[TD]OFF[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]1[/TD]
[TD]OFF[/TD]
[TD]OFF[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]OFF[/TD]
[TD]OFF[/TD]
[TD]3[/TD]
[TD]4[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]E[/TD]
[TD]3[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]OFF[/TD]
[TD]OFF[/TD]
[TD]5[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]F[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]OFF[/TD]
[TD]OFF[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]G[/TD]
[TD]5[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]4[/TD]
[TD]OFF[/TD]
[TD]OFF[/TD]
[/TR]
</tbody><colgroup><col><col><col><col><col><col><col><col></colgroup>[/TABLE]
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
This would do that:

=INDEX($A$1:$A$8,MATCH(1,INDEX($A$1:$H$8,,MATCH("Thursday",$A$1:$H$1,0)),0))
 
Upvote 0

Excel 2010
ABCDEFGH
1EmployeeSundayMondayTuesdayWednesdayThursdayFridaySaturday
2AOFF23451OFF
3BOFFOFF45121
4C1OFFOFF1232
5D23OFFOFF343
6E345OFFOFF54
7F4512OFFOFF5
8G51234OFFOFF
9
101position to find
11ThursdayDay to find
12
13Bemployee
Sheet4
Cell Formulas
RangeFormula
C13=INDEX(A2:A8,MATCH(C10,INDEX(B2:H8,0,MATCH(C11,B1:H1,0)),0))
 
Upvote 0
Adding on to this, would I be able to do it by adding a start time? For example, I want to look up who works position 1 on Thursday at start time of 5?

[TABLE="width: 1326"]
<tbody>[TR]
[TD]Employee[/TD]
[TD]Sunday Pos[/TD]
[TD]Sun Start time[/TD]
[TD]Monday Pos[/TD]
[TD]Mon Start time[/TD]
[TD]Tuesday Pos[/TD]
[TD]Tue Start time[/TD]
[TD]Wednesday Pos[/TD]
[TD]Wed Start time[/TD]
[TD]Thursday Pos[/TD]
[TD]Thu Start Time[/TD]
[TD]Friday Pos[/TD]
[TD]Fri Start time[/TD]
[TD]Saturday Pos[/TD]
[TD]Sat Start time[/TD]
[/TR]
[TR]
[TD]Alex[/TD]
[TD]OFF[/TD]
[TD] [/TD]
[TD]2[/TD]
[TD]5[/TD]
[TD]3[/TD]
[TD]9[/TD]
[TD]1[/TD]
[TD]12[/TD]
[TD]1[/TD]
[TD]12[/TD]
[TD]1[/TD]
[TD]5[/TD]
[TD]OFF[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD]OFF[/TD]
[TD] [/TD]
[TD]OFF[/TD]
[TD] [/TD]
[TD]1[/TD]
[TD]12[/TD]
[TD]1[/TD]
[TD]12[/TD]
[TD]1[/TD]
[TD]5[/TD]
[TD]2[/TD]
[TD]5[/TD]
[TD]1[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]Chris[/TD]
[TD]1[/TD]
[TD]5[/TD]
[TD]OFF[/TD]
[TD] [/TD]
[TD]OFF[/TD]
[TD] [/TD]
[TD]1[/TD]
[TD]5[/TD]
[TD]2[/TD]
[TD]5[/TD]
[TD]3[/TD]
[TD]9[/TD]
[TD]2[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]Dan[/TD]
[TD]2[/TD]
[TD]5[/TD]
[TD]3[/TD]
[TD]9[/TD]
[TD]OFF[/TD]
[TD] [/TD]
[TD]OFF[/TD]
[TD] [/TD]
[TD]3[/TD]
[TD]9[/TD]
[TD]1[/TD]
[TD]12[/TD]
[TD]3[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]Eric[/TD]
[TD]3[/TD]
[TD]9[/TD]
[TD]1[/TD]
[TD]12[/TD]
[TD]1[/TD]
[TD]12[/TD]
[TD]OFF[/TD]
[TD] [/TD]
[TD]OFF[/TD]
[TD] [/TD]
[TD]1[/TD]
[TD]12[/TD]
[TD]1[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]Frank[/TD]
[TD]1[/TD]
[TD]12[/TD]
[TD]1[/TD]
[TD]12[/TD]
[TD]1[/TD]
[TD]5[/TD]
[TD]2[/TD]
[TD]5[/TD]
[TD]OFF[/TD]
[TD] [/TD]
[TD]OFF[/TD]
[TD] [/TD]
[TD]1[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]Greg[/TD]
[TD]2[/TD]
[TD]12[/TD]
[TD]1[/TD]
[TD]5[/TD]
[TD]2[/TD]
[TD]5[/TD]
[TD]3[/TD]
[TD]9[/TD]
[TD]1[/TD]
[TD]12[/TD]
[TD]OFF[/TD]
[TD] [/TD]
[TD]OFF[/TD]
[TD] [/TD]
[/TR]
</tbody><colgroup><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup>[/TABLE]
 
Upvote 0
Adding on to this, would I be able to do it by adding a start time? For example, I want to look up who works position 1 on Thursday at start time of 5?

[TABLE="width: 1326"]
<tbody>[TR]
[TD]Employee[/TD]
[TD]Sunday Pos[/TD]
[TD]Sun Start time[/TD]
[TD]Monday Pos[/TD]
[TD]Mon Start time[/TD]
[TD]Tuesday Pos[/TD]
[TD]Tue Start time[/TD]
[TD]Wednesday Pos[/TD]
[TD]Wed Start time[/TD]
[TD]Thursday Pos[/TD]
[TD]Thu Start Time[/TD]
[TD]Friday Pos[/TD]
[TD]Fri Start time[/TD]
[TD]Saturday Pos[/TD]
[TD]Sat Start time[/TD]
[/TR]
[TR]
[TD]Alex[/TD]
[TD]OFF[/TD]
[TD][/TD]
[TD]2[/TD]
[TD]5[/TD]
[TD]3[/TD]
[TD]9[/TD]
[TD]1[/TD]
[TD]12[/TD]
[TD]1[/TD]
[TD]12[/TD]
[TD]1[/TD]
[TD]5[/TD]
[TD]OFF[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD]OFF[/TD]
[TD][/TD]
[TD]OFF[/TD]
[TD][/TD]
[TD]1[/TD]
[TD]12[/TD]
[TD]1[/TD]
[TD]12[/TD]
[TD]1[/TD]
[TD]5[/TD]
[TD]2[/TD]
[TD]5[/TD]
[TD]1[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]Chris[/TD]
[TD]1[/TD]
[TD]5[/TD]
[TD]OFF[/TD]
[TD][/TD]
[TD]OFF[/TD]
[TD][/TD]
[TD]1[/TD]
[TD]5[/TD]
[TD]2[/TD]
[TD]5[/TD]
[TD]3[/TD]
[TD]9[/TD]
[TD]2[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]Dan[/TD]
[TD]2[/TD]
[TD]5[/TD]
[TD]3[/TD]
[TD]9[/TD]
[TD]OFF[/TD]
[TD][/TD]
[TD]OFF[/TD]
[TD][/TD]
[TD]3[/TD]
[TD]9[/TD]
[TD]1[/TD]
[TD]12[/TD]
[TD]3[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]Eric[/TD]
[TD]3[/TD]
[TD]9[/TD]
[TD]1[/TD]
[TD]12[/TD]
[TD]1[/TD]
[TD]12[/TD]
[TD]OFF[/TD]
[TD][/TD]
[TD]OFF[/TD]
[TD][/TD]
[TD]1[/TD]
[TD]12[/TD]
[TD]1[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]Frank[/TD]
[TD]1[/TD]
[TD]12[/TD]
[TD]1[/TD]
[TD]12[/TD]
[TD]1[/TD]
[TD]5[/TD]
[TD]2[/TD]
[TD]5[/TD]
[TD]OFF[/TD]
[TD][/TD]
[TD]OFF[/TD]
[TD][/TD]
[TD]1[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]Greg[/TD]
[TD]2[/TD]
[TD]12[/TD]
[TD]1[/TD]
[TD]5[/TD]
[TD]2[/TD]
[TD]5[/TD]
[TD]3[/TD]
[TD]9[/TD]
[TD]1[/TD]
[TD]12[/TD]
[TD]OFF[/TD]
[TD][/TD]
[TD]OFF[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

I think this would work for you:

Its an array so ctrl + shift + enter

=INDEX(A2:A8, MATCH(1, (1=J2:J8)*(5=K2:K8),0))
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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