Excel Formula amendment

mrsushi

Board Regular
Joined
Nov 18, 2006
Messages
125
Office Version
  1. 2010
I have this formula in Excel (as per below). The result returns the date 07.10.2021

=MAX(IF(H2:H48<TODAY(),H2:H48))-1

The List that its referencing is Column I and has a number of dates

16/09/2021​
23/09/2021​
01/10/2021​
08/10/2021​
15/10/2021​
22/10/2021​
01/11/2021​
10/11/2021​
17/11/2021​

Is there anyway the formula can be tweeked to keep the return value on 7th when today becomes the 15th? As you will see from the above formula, when the day becomes the 15th, it will select 15th - 1 day giving a return value of the 14th.

Any ideas will be much appreciated

Many thanks
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
67,826
Office Version
  1. 365
Platform
  1. Windows
That formula will return the 7th when today is the 15th.
 

mrsushi

Board Regular
Joined
Nov 18, 2006
Messages
125
Office Version
  1. 2010
That formula will return the 7th when today is the 15th.
Sorry i meant from tomorrow, how can the formula be amended to select the previous 2 dates in the list ie 7th.
Would it be best to use another formula which selects the previous 2 dates when it pasts the data ie Today itself?
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
67,826
Office Version
  1. 365
Platform
  1. Windows
How about
Excel Formula:
=MAX(IF(H2:H48<TODAY()-2,H2:H48))-1
 
Solution

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
67,826
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 
Learn Excel from Bill Jelen

Understanding data is crucial, and the easiest place to start is with Microsoft Excel.

Forum statistics

Threads
1,151,589
Messages
5,765,308
Members
425,272
Latest member
Umba

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
Top