Forum Discussion
jlgomes
Aug 17, 2022Copper Contributor
Earliest date
Hi, I would like to get the earliest date from a set of data where per each person I've got more than a date. I´m struggling to get the unique name and the earliest date as shown above. Any...
PeterBartholomew1
Aug 17, 2022Silver Contributor
To add to this as a demo of modern Excel, the Lambda function could be reused to allow the person with the latest start date to be identified.
= LET(
latestStart, MAX(EarliestDateλ(UNIQUE(name))),
FILTER(Input, date=latestStart)
)SergeiBaklan
Aug 17, 2022Diamond Contributor
As variant
=LET(
s, SORT( Input, 2, 1),
u, UNIQUE( Input[Name] ),
HSTACK( u, XLOOKUP( u, CHOOSECOLS( s, 1 ), CHOOSECOLS( s, 2) ) ) )
and descending sort for the latest date. For the latest startdate
=LET(
s, SORT( Input, 2, 1),
u, UNIQUE( Input[Name] ),
m, MAX( XMATCH( u, CHOOSECOLS( s, 1) ) ),
CHOOSEROWS( s, m ) )
- PeterBartholomew1Aug 17, 2022Silver Contributor
I would be happy to go with those! It seems we have a surfeit of choice when it comes to selecting the best methods at the moment. I suspect I tend to resort to thunks too readily and I still have to get to the bottom of the array shaping possibilities offered by TOROW/COL, WRAPROWS/COLS, SORT!