Scan row of dates to return most recent date before today

studio95

Board Regular
Joined
Aug 13, 2012
Messages
83
Morning all,

I have the following calculation in my sheet :-

=IF(AT154="","",MAX(AT154:CI154))

if there is a date in present in AT154 then this formula will look along that row and in cell AJ154 will return the value of the most recent date in that row. However we have now started to record future dates in this row which I want to ignore and only return a value in AJ154 of the most recent date prior to today.

Could someone please modify this to achieve that?

Thank you kindly.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Code:
=IF(AT154="","",MAX(IF(AT154:CI154<TODAY(),AT154:CI154)))
<today(),at154:ci154)))

Entered with Ctrl+Shift+Enter. If you have MAXIFS available you could also do it like this:

Code:
=IF(AT154="","",MAXIFS(AT154:CI154,AT154:CI154,"<"&TODAY()))

WBD</today(),at154:ci154)))
 
Last edited:
Upvote 0
=IF(AT154="","",MAX(IF(AT154:CI154<TODAY(),AT154:CI154)))
<today(),at154:ci154)))

Entered with Ctrl+Shift+Enter. If you have MAXIFS available you could also do it like this:

Worked perfectly thank you so much </today(),at154:ci154)))
 
Upvote 0

Forum statistics

Threads
1,216,172
Messages
6,129,290
Members
449,498
Latest member
Lee_ray

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top