Xlookup or index & match

mipasodu

New Member
Joined
Sep 29, 2022
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hi, I have tried to use vlookup, xlookup (nested) and Index and match but I'm making a mess. I need to lookup a worker's name from a list and then return the most recent date that matches the course name. sample data attached

Course Log.xlsx
ABCDEFGHIJKLMNOPQRST
1!! Data exported from course system in A1:H50!! Workers can repeat courses every 1 or 2 yearsWorkers might have done every course, every year since employment beganI need the most recent course date in M2:T11Course ACourse BCourse CCourse DCourse ECourse FCourse GCourse H
2WorkerStatusRoleCCCourseTR StatusYearCompletedWorker 1
3Worker 1ActiveFactory1234Course ACompleted20194.3.2019Worker 2
4Worker 1ActiveFactory1234Course ACompleted20201.2.2020Worker 3
5Worker 1ActiveFactory1234Course ACompleted202120.1.2021Worker 4
6Worker 1ActiveFactory1234Course BCompleted20214.3.2021Worker 5
7Worker 1ActiveFactory1234Course GCompleted202010.1.2020
8Worker 1ActiveFactory1234Course BCompleted202019.12.2020
9Worker 1ActiveFactory1234Course CCompleted201927.8.2019
10Worker 1ActiveFactory1234Course CCompleted20216.8.2021
11Worker 2ActiveFactory1234Course ACompleted202014.8.2020
12Worker 2ActiveFactory1234Course ACompleted202020.4.2020
13Worker 2ActiveFactory1234Course ACompleted202115.8.2021
14Worker 2ActiveFactory1234Course BCompleted20212.1.2021
15Worker 2ActiveFactory1234Course ACompleted20227.9.2022
16Worker 2ActiveFactory1234Course ACompleted20227.9.2022
17Worker 3ActiveFactory1234Course HCompleted202115.8.2021
18Worker 3ActiveFactory1234Course BCompleted20232.1.2023
19Worker 3ActiveFactory1234Course BCompleted20211.9.2021
20Worker 3ActiveFactory1234Course BCompleted20228.10.2022
21Worker 3ActiveFactory1234Course CCompleted20221.7.2022
22Worker 3ActiveFactory1234Course FCompleted20228.7.2022
23Worker 3ActiveFactory1234Course ACompleted202125.6.2021
24Worker 3ActiveFactory1234Course ACompleted201928.8.2019
25Worker 3ActiveFactory1234Course BCompleted202118.3.2021
26Worker 3ActiveFactory1234Course ECompleted201927.8.2019
27Worker 3ActiveFactory1234Course BCompleted20216.8.2021
28Worker 3ActiveFactory1234Course CCompleted202014.8.2020
29Worker 3ActiveFactory1234Course CCompleted202020.4.2020
30Worker 3ActiveFactory1234Course ACompleted202115.8.2021
31Worker 3ActiveFactory1234Course ACompleted202125.6.2021
32Worker 3ActiveFactory1234Course ACompleted201928.8.2019
33Worker 4ActiveFactory1234Course BCompleted202118.3.2021
34Worker 4ActiveFactory1234Course BCompleted201927.8.2019
35Worker 4ActiveFactory1234Course BCompleted20216.8.2021
36Worker 4ActiveFactory1234Course CCompleted202014.8.2020
37Worker 4ActiveFactory1234Course CCompleted202020.4.2020
38Worker 4ActiveFactory1234Course ACompleted202115.8.2021
39Worker 4ActiveFactory1234Course ACompleted20212.1.2021
40Worker 5ActiveFactory1234Course ACompleted20227.9.2022
41Worker 5ActiveFactory1234Course DCompleted20227.9.2022
42Worker 5ActiveFactory1234Course BCompleted202014.8.2020
43Worker 5ActiveFactory1234Course BCompleted202020.4.2020
44Worker 5ActiveFactory1234Course CCompleted202115.8.2021
45Worker 5ActiveFactory1234Course CCompleted20212.1.2021
46Worker 5ActiveFactory1234Course ACompleted20227.9.2022
47Worker 5ActiveFactory1234Course ACompleted20227.9.2022
48Worker 5ActiveFactory1234Course ACompleted202115.8.2021
49Worker 5ActiveFactory1234Course BCompleted20212.1.2021
50Worker 5ActiveFactory1234Course BCompleted20211.9.2021
Sheet1
Cell Formulas
RangeFormula
G3:G50G3=H3
 

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.
I currently have "=INDEX(H3:H50;MATCH(L2;A3:A50;0))" in M2 but I need to add something to the formula to make it look for the most recent date.
 
Upvote 0
Hi & welcome to MrExcel.
How about
Fluff.xlsm
ABCDEFGHIJKLMNOPQRST
1Course ACourse BCourse CCourse DCourse ECourse FCourse GCourse H
2WorkerStatusRoleCCCourseTR StatusYearCompletedWorker 120/01/202119/12/202006/08/2021   10/01/2020 
3Worker 1ActiveFactory1234Course ACompleted201904/03/2019Worker 207/09/202202/01/2021      
4Worker 1ActiveFactory1234Course ACompleted202001/02/2020Worker 328/08/201906/08/202120/04/2020 27/08/201908/07/2022 15/08/2021
5Worker 1ActiveFactory1234Course ACompleted202120/01/2021Worker 402/01/202106/08/202120/04/2020     
6Worker 1ActiveFactory1234Course BCompleted202104/03/2021Worker 515/08/202101/09/202102/01/202107/09/2022    
7Worker 1ActiveFactory1234Course GCompleted202010/01/2020
8Worker 1ActiveFactory1234Course BCompleted202019/12/2020
9Worker 1ActiveFactory1234Course CCompleted201927/08/2019
10Worker 1ActiveFactory1234Course CCompleted202106/08/2021
11Worker 2ActiveFactory1234Course ACompleted202014/08/2020
12Worker 2ActiveFactory1234Course ACompleted202020/04/2020
13Worker 2ActiveFactory1234Course ACompleted202115/08/2021
14Worker 2ActiveFactory1234Course BCompleted202102/01/2021
15Worker 2ActiveFactory1234Course ACompleted202207/09/2022
16Worker 2ActiveFactory1234Course ACompleted202207/09/2022
17Worker 3ActiveFactory1234Course HCompleted202115/08/2021
18Worker 3ActiveFactory1234Course BCompleted202302/01/2023
19Worker 3ActiveFactory1234Course BCompleted202101/09/2021
20Worker 3ActiveFactory1234Course BCompleted202208/10/2022
21Worker 3ActiveFactory1234Course CCompleted202201/07/2022
22Worker 3ActiveFactory1234Course FCompleted202208/07/2022
23Worker 3ActiveFactory1234Course ACompleted202125/06/2021
24Worker 3ActiveFactory1234Course ACompleted201928/08/2019
25Worker 3ActiveFactory1234Course BCompleted202118/03/2021
26Worker 3ActiveFactory1234Course ECompleted201927/08/2019
27Worker 3ActiveFactory1234Course BCompleted202106/08/2021
28Worker 3ActiveFactory1234Course CCompleted202014/08/2020
29Worker 3ActiveFactory1234Course CCompleted202020/04/2020
30Worker 3ActiveFactory1234Course ACompleted202115/08/2021
31Worker 3ActiveFactory1234Course ACompleted202125/06/2021
32Worker 3ActiveFactory1234Course ACompleted201928/08/2019
33Worker 4ActiveFactory1234Course BCompleted202118/03/2021
34Worker 4ActiveFactory1234Course BCompleted201927/08/2019
35Worker 4ActiveFactory1234Course BCompleted202106/08/2021
36Worker 4ActiveFactory1234Course CCompleted202014/08/2020
37Worker 4ActiveFactory1234Course CCompleted202020/04/2020
38Worker 4ActiveFactory1234Course ACompleted202115/08/2021
39Worker 4ActiveFactory1234Course ACompleted202102/01/2021
40Worker 5ActiveFactory1234Course ACompleted202207/09/2022
41Worker 5ActiveFactory1234Course DCompleted202207/09/2022
42Worker 5ActiveFactory1234Course BCompleted202014/08/2020
43Worker 5ActiveFactory1234Course BCompleted202020/04/2020
44Worker 5ActiveFactory1234Course CCompleted202115/08/2021
45Worker 5ActiveFactory1234Course CCompleted202102/01/2021
46Worker 5ActiveFactory1234Course ACompleted202207/09/2022
47Worker 5ActiveFactory1234Course ACompleted202207/09/2022
48Worker 5ActiveFactory1234Course ACompleted202115/08/2021
49Worker 5ActiveFactory1234Course BCompleted202102/01/2021
50Worker 5ActiveFactory1234Course BCompleted202101/09/2021
Master
Cell Formulas
RangeFormula
M2:T6M2=IFERROR(INDEX($H:$H,AGGREGATE(14,6,ROW($A$2:$A$50)/($E$2:$E$50=M$1)/($A$2:$A$150=$L2),1)),"")
G3:G50G3=H3
 
Upvote 0
Solution
Hi & welcome to MrExcel.
How about
Fluff.xlsm
ABCDEFGHIJKLMNOPQRST
1Course ACourse BCourse CCourse DCourse ECourse FCourse GCourse H
2WorkerStatusRoleCCCourseTR StatusYearCompletedWorker 120/01/202119/12/202006/08/2021   10/01/2020 
3Worker 1ActiveFactory1234Course ACompleted201904/03/2019Worker 207/09/202202/01/2021      
4Worker 1ActiveFactory1234Course ACompleted202001/02/2020Worker 328/08/201906/08/202120/04/2020 27/08/201908/07/2022 15/08/2021
5Worker 1ActiveFactory1234Course ACompleted202120/01/2021Worker 402/01/202106/08/202120/04/2020     
6Worker 1ActiveFactory1234Course BCompleted202104/03/2021Worker 515/08/202101/09/202102/01/202107/09/2022    
7Worker 1ActiveFactory1234Course GCompleted202010/01/2020
8Worker 1ActiveFactory1234Course BCompleted202019/12/2020
9Worker 1ActiveFactory1234Course CCompleted201927/08/2019
10Worker 1ActiveFactory1234Course CCompleted202106/08/2021
11Worker 2ActiveFactory1234Course ACompleted202014/08/2020
12Worker 2ActiveFactory1234Course ACompleted202020/04/2020
13Worker 2ActiveFactory1234Course ACompleted202115/08/2021
14Worker 2ActiveFactory1234Course BCompleted202102/01/2021
15Worker 2ActiveFactory1234Course ACompleted202207/09/2022
16Worker 2ActiveFactory1234Course ACompleted202207/09/2022
17Worker 3ActiveFactory1234Course HCompleted202115/08/2021
18Worker 3ActiveFactory1234Course BCompleted202302/01/2023
19Worker 3ActiveFactory1234Course BCompleted202101/09/2021
20Worker 3ActiveFactory1234Course BCompleted202208/10/2022
21Worker 3ActiveFactory1234Course CCompleted202201/07/2022
22Worker 3ActiveFactory1234Course FCompleted202208/07/2022
23Worker 3ActiveFactory1234Course ACompleted202125/06/2021
24Worker 3ActiveFactory1234Course ACompleted201928/08/2019
25Worker 3ActiveFactory1234Course BCompleted202118/03/2021
26Worker 3ActiveFactory1234Course ECompleted201927/08/2019
27Worker 3ActiveFactory1234Course BCompleted202106/08/2021
28Worker 3ActiveFactory1234Course CCompleted202014/08/2020
29Worker 3ActiveFactory1234Course CCompleted202020/04/2020
30Worker 3ActiveFactory1234Course ACompleted202115/08/2021
31Worker 3ActiveFactory1234Course ACompleted202125/06/2021
32Worker 3ActiveFactory1234Course ACompleted201928/08/2019
33Worker 4ActiveFactory1234Course BCompleted202118/03/2021
34Worker 4ActiveFactory1234Course BCompleted201927/08/2019
35Worker 4ActiveFactory1234Course BCompleted202106/08/2021
36Worker 4ActiveFactory1234Course CCompleted202014/08/2020
37Worker 4ActiveFactory1234Course CCompleted202020/04/2020
38Worker 4ActiveFactory1234Course ACompleted202115/08/2021
39Worker 4ActiveFactory1234Course ACompleted202102/01/2021
40Worker 5ActiveFactory1234Course ACompleted202207/09/2022
41Worker 5ActiveFactory1234Course DCompleted202207/09/2022
42Worker 5ActiveFactory1234Course BCompleted202014/08/2020
43Worker 5ActiveFactory1234Course BCompleted202020/04/2020
44Worker 5ActiveFactory1234Course CCompleted202115/08/2021
45Worker 5ActiveFactory1234Course CCompleted202102/01/2021
46Worker 5ActiveFactory1234Course ACompleted202207/09/2022
47Worker 5ActiveFactory1234Course ACompleted202207/09/2022
48Worker 5ActiveFactory1234Course ACompleted202115/08/2021
49Worker 5ActiveFactory1234Course BCompleted202102/01/2021
50Worker 5ActiveFactory1234Course BCompleted202101/09/2021
Master
Cell Formulas
RangeFormula
M2:T6M2=IFERROR(INDEX($H:$H,AGGREGATE(14,6,ROW($A$2:$A$50)/($E$2:$E$50=M$1)/($A$2:$A$150=$L2),1)),"")
G3:G50G3=H3
Yes that works, I need to change it slightly for the live sheet but your formula was perfect, thank you
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,863
Messages
6,175,049
Members
452,606
Latest member
jkondrat14

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