Return date of 1st Mon in month which is not a Bank Holiday/weekend

halesowenmum

Active Member
Joined
Oct 20, 2010
Messages
383
Office Version
  1. 365
Platform
  1. Windows
Hi all

In cell J4 I have the date 01/11/2018.
In cell B15 I want to return the date of the first Monday in the month of November (calculating off the date in J4 (which will always be the first of the month))
BUT
where the Monday is a Bank Holiday return the date for the Tuesday, if the bank holiday were a Friday return the date of the following Monday so long as it's not a bank holiday, etc - so Mondays but so long as they're not bank holidays or a weekend day).

The list of bank holidays is in a separate worksheet entitled 'Lists' and the named range of the BHs is 'Bank_holidays'.

Is it possible to do this?

Many thanks indeed.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
this will work out the first Monday of the date in J4

Code:
=DATE(YEAR(J4),MONTH(J4),DAY(DATE(YEAR(J4),MONTH(J4),8)-WEEKDAY(DATE(YEAR(J4),MONTH(J4),6))))

you can check this against the BHs list, if it's Monday then add 1 day
 
Upvote 0
Thank you - however, does this mean I've got to manually check something and then manually add something???
 
Upvote 0
let say your dates in Col A, Col B workd out the first Monday, Col C check these against the BH_list, and add 1 day if it's a Bank holiday Monday.
you can combine Cols B&C into 1 if wanted


Book1
ABCDE
101/09/201803/09/201803/09/2018BH
201/10/201801/10/201801/10/201815/07/2018
301/11/201805/11/201806/11/201808/08/2018
401/12/201803/12/201803/12/201804/09/2018
528/09/2018
619/10/2018
705/11/2018
Sheet1
Cell Formulas
RangeFormula
B1=DATE(YEAR(A1),MONTH(A1),DAY(DATE(YEAR(A1),MONTH(A1),8)-WEEKDAY(DATE(YEAR(A1),MONTH(A1),6))))
C1=IF(ISERROR(MATCH(B1,E:E,0)),B1,B1+1)
 
Upvote 0
Hi. Thanks very much indeed. I guess I'm not understanding why it can't be done (if this is the case) in one step, in one formula - all I want to do is in a filled down column of dates, for the first date (in cell B15) to be the first Monday of the month (or next non-weekend/non-holiday day) of the month. The bank holidays are already specifically defined in a named range so I thought I'd be able to refer to WORKDAYS (say) and the named range but tell it to find the next suitable working day...

Do I need to go ahead and create another named range for the weekends to enable it to be done in one fell swoop in a single formula???

I guess the add 1 day if it's a Monday is ok but what if it's Good Friday - adding one day wouldn't work and if it was a Bank Holiday over Xmas that fell on say a Wednesday, the add one day wouldn't work possibly?
 
Last edited:
Upvote 0
it's now combined to 1 formula, just difficult to read/audit, that's all


Book1
ABCDE
101/09/201803/09/2018BH
201/10/201801/10/201815/07/2018
301/11/201806/11/201808/08/2018
401/12/201803/12/201804/09/2018
528/09/2018
619/10/2018
705/11/2018
Sheet1
Cell Formulas
RangeFormula
C1=IF(ISERROR(MATCH(DATE(YEAR(A1),MONTH(A1),DAY(DATE(YEAR(A1),MONTH(A1),8)-WEEKDAY(DATE(YEAR(A1),MONTH(A1),6)))),E:E,0)),DATE(YEAR(A1),MONTH(A1),DAY(DATE(YEAR(A1),MONTH(A1),8)-WEEKDAY(DATE(YEAR(A1),MONTH(A1),6)))),DATE(YEAR(A1),MONTH(A1),DAY(DATE(YEAR(A1),MONTH(A1),8)-WEEKDAY(DATE(YEAR(A1),MONTH(A1),6))))+1)


I guess the add 1 day if it's a Monday is ok but what if it's Good Friday - adding one day wouldn't work and if it was a Bank Holiday over Xmas that fell on say a Wednesday, the add one day wouldn't work possibly?

not quite understand, aren't you just wanted the first Monday of the month?
 
Upvote 0
Im not quite sure what Fridays have got to do with finding the next Monday but try this and see if it gets the right day:

=WORKDAY(A1+6-WEEKDAY(A1-2),1,holidays)
 
Upvote 0
Im not quite sure what Fridays have got to do with finding the next Monday but try this and see if it gets the right day:

=WORKDAY(A1+6-WEEKDAY(A1-2),1,holidays)

mine is longer than yours ;)
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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