Counted Days

francoiscj1

New Member
Joined
Aug 21, 2017
Messages
15
This is my formula:

=IF(ISERROR(MATCH(A1+37,$E$1:$E$12,0)),IF(WEEKDAY(A1+37)=7,A1+37-1,IF(WEEKDAY(A1+37)=1,A1+37-2,A1+37)),IF(WEEKDAY(A1+37-1)=7,A1+37-2,IF(WEEKDAY(A1+37-1)=1,A1+37-3,A1+37-1)))

My holidays are E1:E12

I would like to amend this formula so that if the date lands on Tuesday through Friday, it will land on the following Monday. For example, if the date is 02/07/18, the date will land on 02/12/18.

Thank you for the help.
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

BrianJN1

Well-known Member
Joined
Jun 15, 2017
Messages
603
I don't know if I can help but I'd really like to see a table as to what that all means.
I'm assuming that Col A is a sequence of dates and Col E (rather E1:E12) is what you'd like to see?

Then too, where will that formula reside? F1:F12 dragged down?
 
Last edited:

kvsrinivasamurthy

Well-known Member
Joined
Nov 6, 2013
Messages
697
Try this. Works in version 2010 onwords.

=if(weekday(your formula,16)>3,your formula+10-weekday(your formula,16),your formula)
 

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
Your current formula seems to be adding 37 days to a date and then adjusting it to the previous day, if a holiday, or previous Friday if original or adjusted day lands on a weekend. You could do that more easily using WORKDAY function like this:

=WORKDAY(A1+37+1,-1,holidays)

If you only want to get a Monday as the answer then you can do something similar with WORKDAY.INTL, I.e

=WORKDAY.INTL(A1+37-1,1,"0111111",holidays)

That will always give you a Monday, either exactly A1+37 if that,s a Monday, or the following Monday if it’s not
 

Watch MrExcel Video

Forum statistics

Threads
1,130,309
Messages
5,641,448
Members
417,209
Latest member
Agbarker

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