SOLVED

MAX date when less than another date

Copper Contributor

hi, im looking for a formula that will find the max date in a range where the date is less than another cell. 

 

example below of what im looking for (last_out date (expected result)

i am trying to find the MAX date_out for each barcode number which is not greater than returned date

thanks in advance

 

BarcodeDate_out BarcodeReturned DateLast_Out date (expected result)
555666620/12/2021 555666606/04/202306/01/2023
555666606/01/2023 44488802/01/202320/12/2021
44488820/12/2021    
44488806/01/2023    
3 Replies
best response confirmed by Hans Vogelaar (MVP)
Solution

@thomaspowell250 

=MAXIFS(Date_out_column,Barcode_column,Barcode,Date_out_column,"<"&Returned_date)

@thomaspowell250 Following both formula should work-

=MAX(FILTER($B$2:$B$5,($A$2:$A$5=D2)*($B$2:$B$5<E2)))
=MAXIFS($B$2:$B$5,$A$2:$A$5,D2,$B$2:$B$5,"<"&E2)

Harun24HR_0-1684985061062.png

 

 

thank you both, it worked, i had the same formula but as the data is part of a table i was using the @column instead of the $B$5:...... which was giving me the error.

 

thanks again 

1 best response

Accepted Solutions
best response confirmed by Hans Vogelaar (MVP)
Solution

@thomaspowell250 

=MAXIFS(Date_out_column,Barcode_column,Barcode,Date_out_column,"<"&Returned_date)

View solution in original post