Xlookup min and max
 

MegaSack DRAW - This year's winner is user - rgwb
We will be in touch

[Closed] Xlookup min and max

3 Posts
3 Users
0 Reactions
103 Views
Posts: 1106
Free Member
Topic starter
 

I'm trying to get a formula that returns two sets of oldest and newest dates from one column of a table which has dates in col A and category in col B.

So category A oldest and newest, category B oldest and newest.

I've been trying (with named ranges 'date' and 'category'):
=Xlookup(min(date),(category=B2)*date,date,,-1)

The above seems to work when using 'max' but it's not working for finding one of the 'min' dates.

Any suggestions?

Thanks


 
Posted : 31/03/2022 11:20 am
Posts: 1294
Free Member
 

Try MINIFS and MAXIFS.

=MINIFS(date column, category column, category)


 
Posted : 31/03/2022 11:36 am
Posts: 1324
Full Member
 

or small(,1), large(,1) - to get the smallest, largest value in a range and use that in your lookup?


 
Posted : 31/03/2022 12:01 pm
Posts: 1106
Free Member
Topic starter
 

Thanks both 👍


 
Posted : 31/03/2022 3:05 pm