Latest value based on most recent date

JoshLyman

New Member
Joined
Jan 11, 2023
Messages
35
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Struggling to figure out what the best way is to return the COMPSTATUS which corresponds with the latest LEARNSTARTDATE for each Regno. I'm assuming it will be best achieved by using INDEX and SORT but can't quite decide where to start. An example of it working would be by returning the following for these Regno

A567883 = 1
A671172 = 3
B312726 = 1

2223-LearningDelivery (20).csv
ALUAE
1RegnoLEARNSTARTDATECOMPSTATUSLATESTSTATUS
2A56788313-Oct-211
3A56788313-Oct-211
4A67117222-Jan-206
5A67117222-Jan-206
6A67117223-Jun-223
7A67117223-Jun-223
8B01835330-Sep-191
9B01835330-Sep-191
10B11915807-Oct-202
11B11915807-Oct-202
12B21697813-Oct-211
13B21697813-Oct-212
14B21843305-Oct-203
15B21843305-Oct-203
16B21901204-Oct-211
17B21901204-Oct-211
18B31272612-Oct-226
19B31272612-Oct-226
20B31272627-Feb-231
21B31272627-Feb-231
2223-LearningDelivery (20)


Thanks in advance.
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
How about
Excel Formula:
=XLOOKUP(A2,$A$2:$A$21,$U$2:$U$21,"",0,-1)
 
Upvote 0
Thanks @Fluff. This works if I sort the LEARNSTARTDATE oldest to newst (which I do, generally), but if it's sorted newest to oldest it does the reverse. Not the absolute end of the world though, will just need to be careful when sorting!

1694011389163.png


1694011416541.png
 
Upvote 0
Ok, how about
Excel Formula:
=TAKE(SORT(FILTER($L$2:$U$21,$A$2:$A$21=A2),1,-1),1,-1)
 
Upvote 1
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,333
Messages
6,124,317
Members
449,153
Latest member
JazzSingerNL

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