Xlookup min and max
 

[Closed] Xlookup min and max

Posts: 1110
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 12:20 pm
Posts: 1294
Free Member
 

Try MINIFS and MAXIFS.

=MINIFS(date column, category column, category)


 
Posted : 31/03/2022 12:36 pm
Posts: 1331
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 1:01 pm
Posts: 1110
Free Member
Topic starter
 

Thanks both 👍


 
Posted : 31/03/2022 4:05 pm