provision for holidays with EDATE

Benjaminmin

Board Regular
Joined
Nov 20, 2009
Messages
116
Hi,

I have a long list of dates and corresponding prices, which I need to do a 9-monthly comparison on (i.e. i take date A, and then the same date but 9 months later, which would just be edate(A,9)).

However, the problem is that the date list excludes weekends and holidays, but edate doesnt account for that obviously, so I need something that will take the date 9 days from now, but if its a sat/sun/holiday (i.e. a date not existing in the list) I just want the next possible days value.

I have -almost- done it with: =INDEX(A$4:A$10000,MATCH(VLOOKUP(EDATE(C6,9),A4:A10000,1),A$4:A$10000,0)+1)

for example if the start date (C6) is friday 18/07/1997 and you just use edate,9 you would get the value 18/04/1998 (which is a saturday).

The above formula, correctly returns 20/04/1998, which is the following monday (eureka!).

My problem now though is that it will always add a day, so even if it landed on a Tuesday, it will return Wednesday's date.

So what I need from you guys, please, is some sort of IF constraint to the formula, so it ONLY adds one day IF the proposed EDATE,9 returns a value that doesnt exist in the line.

If anyone could help me it would be a miracle.

Thanks in advance
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Never mind, you can lock this.
I figured out a way to do it myself:
=IF(ISNA(VLOOKUP(EDATE(C6,9),A4:A10000,1,0)),INDEX(A$4:A$10000,MATCH(VLOOKUP(EDATE(C6,9),A4:A10000,1),A$4:A$10000,0)+1),EDATE(C6,9))
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,351
Members
452,907
Latest member
Roland Deschain

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