Home » excel » Return a date based on criteria in excel

Return a date based on criteria in excel

Posted by: admin May 14, 2020 Leave a comment


I have a table of athlete names, training sessions and completion dates.

From this table, I want to extract the most recent dates (excluding the current date) that a specific athlete completed a specific session.

So far my formula is as follows:

= IF (MATCH ($AC27&$AD27
            ,'Data'!$A$2:$A$2000 & 'Data'!$BS$2:$BS$2000
            , 0
     ,MAX(('Data'!$B$2:$B$2000 < $AE$1) * 'Data'!$B$2:$B$2000)


'Data'!        - Threshold Efforts Data Entry sheet
$AC$27         - specific athlete name 
AD$27          - specific athlete session 
$A$2:$A$2000   - lookup array for athlete names
$BS$2:$BS$2000 - look up array for sessions
$B$2:$B$2000   - look up array for dates
$AE$1          - the current date

The formula works, however it returns the most recent date, rather than the most recent date matched for the athlete name and session.

Where have I gone wrong ?

How to&Answers:

This works for me.


It’s an array function, so click in the cell and press ctrl + shift + enter.

enter image description here


I tried to follow your cell references. You can use a combination of SUMPRODUCT and MAX:


Here’s the result:

enter image description here