WORKDAY.INTL does not block out holidays

shawnbull

New Member
Joined
Nov 27, 2007
Messages
35
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
I am using the following:-=WORKDAY.INTL(Z5,0,1,'date calcs'!$F$5:$F$19) to set up a list of date that correspond to dates from
Mon to Fri, but should exclude public holidays.
The Z column captures all the dates in sequence that follows Mon to Friday based on the weekday formula.
My understanding is that public holidays should not show if the date falls on a public holiday, yet 25 Dec and 26 Dec both
public holidays in RSA show up.
The "date calcs'!$F$5:$F$19 is the worksheet reference to the public holidays.

Can anyone assist as regards what the error may be

or provide a solution where the month and year is derived from the tab name eg DEC 2024
and incorporated into a date(B1,A1,C1) function where B1 is the derived year, A1 is the derived month and C1 is the 1st weekday of the month.
The rows run in sequence from the 1st weekday date of the month to the last weekday date of the month, but should exclude
the public holidays
So Dec 2024 should look something like this:-
02/12/2024 (falls on a Monday)
03/12/2024
04/12/2024
05/12/2024
06/12/2024 (Falls on a Friday)
09/12/2024 (skips weekend to next Monday)
etc to week of Christmas that should look like this
23/12/2024 (the Monday)
24/12/2024
27/12/2024 (skips the public holidays)
30/12/2024 (skips the weekend)
31/12/2024
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Hi, if you are trying to return the following workday if the date in Z5 is a non working day, but just return the date that is in Z5 if it is already a working day then you could try:
=WORKDAY.INTL(Z5-1,1,1,'date calcs'!$F$5:$F$19)

If you're trying to do something else, then try to explain in words what it is you are trying to do.
 
Upvote 0
Review the following and review Excel's help files.
You can then adapt the information to your specific requirements.
You can post an extract of your sheet with the forum's tool named XL2BB.

T202401a.xlsm
ABCD
1Holidays
2Wed 20-Dec-2325-12-23
3Thu 21-Dec-2326-12-23
4Fri 22-Dec-2301-01-24
5Wed 27-Dec-23
6Thu 28-Dec-23
7Fri 29-Dec-23
8Tue 02-Jan-24
9Wed 03-Jan-24
3d
Cell Formulas
RangeFormula
A3:A9A3=WORKDAY.INTL(A2,1,1,Holidays)
Named Ranges
NameRefers ToCells
Holidays='3d'!$D$2:$D$4A3:A9
 
Upvote 0
There was no feedback; we must have answered the question.
For interested people who read the thread, I built a function and I also showed some of the components.
The relevant month is derived from the sheet name.
The holidays relevant to the relevant month would have to included in the Holiday range.

In Name Manager
- enter a name that you prefer for the function
- Value paste the Lambda information

T202401a.xlsm
M
1Mon 02-Dec-24
2Tue 03-Dec-24
3Wed 04-Dec-24
4Thu 05-Dec-24
5Fri 06-Dec-24
6Mon 09-Dec-24
7Tue 10-Dec-24
8Wed 11-Dec-24
9Thu 12-Dec-24
10Fri 13-Dec-24
11Mon 16-Dec-24
12Tue 17-Dec-24
13Wed 18-Dec-24
14Thu 19-Dec-24
15Fri 20-Dec-24
16Mon 23-Dec-24
17Tue 24-Dec-24
18Wed 25-Dec-24
19Thu 26-Dec-24
20Fri 27-Dec-24
21Mon 30-Dec-24
22Tue 31-Dec-24
23
Dec 2024
Cell Formulas
RangeFormula
M1:M22M1=wDays()
Dynamic array formulas.
Named Ranges
NameRefers ToCells
Holidays='Dec 2024'!$J$2:$J$4M1
Lambda Functions
NameFormula
SheetName=LAMBDA(TEXTAFTER(CELL("filename",!$A$1),"]"))
wDays=LAMBDA(LET(d,TEXTSPLIT(SheetName()," "),s,DATE(INDEX(d,2),MONTH(INDEX(d,1)&("-1")),1)-1,WORKDAY.INTL(s,SEQUENCE(NETWORKDAYS.INTL(s,EOMONTH(s,1),1,Holidays)),1,Holidays)))



T202401a.xlsm
GHIJ
1MonthYearWorkdaysHolidays
2Dec202422Mon 25-Dec-23
3Tue 26-Dec-23
4Sat 30-Nov-24Tue 31-Dec-24Mon 01-Jan-24
5
Dec 2024
Cell Formulas
RangeFormula
G2:H2G2=TEXTSPLIT(SheetName()," ")
I2I2=LET(d,TEXTSPLIT(SheetName()," "),b,DATE(INDEX(d,2),MONTH(INDEX(d,1)&("-1")),1)-1,NETWORKDAYS.INTL(b,EOMONTH(b,1),1,Holidays))
G4G4=LET(d,TEXTSPLIT(SheetName()," "),DATE(INDEX(d,2),MONTH(INDEX(d,1)&("-1")),1)-1)
H4H4=EOMONTH(G4,1)
Dynamic array formulas.
Named Ranges
NameRefers ToCells
Holidays='Dec 2024'!$J$2:$J$4I2
 
Upvote 0
T202401a.xlsm
M
1Fri 01-Mar-24
2Mon 04-Mar-24
3Tue 05-Mar-24
4Wed 06-Mar-24
5Thu 07-Mar-24
6Fri 08-Mar-24
7Mon 11-Mar-24
8Tue 12-Mar-24
9Wed 13-Mar-24
10Thu 14-Mar-24
11Fri 15-Mar-24
12Mon 18-Mar-24
13Tue 19-Mar-24
14Wed 20-Mar-24
15Thu 21-Mar-24
16Fri 22-Mar-24
17Mon 25-Mar-24
18Tue 26-Mar-24
19Wed 27-Mar-24
20Thu 28-Mar-24
21Fri 29-Mar-24
Mar 2024
Cell Formulas
RangeFormula
M1:M21M1=wDays()
Dynamic array formulas.
Named Ranges
NameRefers ToCells
Holidays='Mar 2024'!$J$2:$J$4M1
Lambda Functions
NameFormula
Date1=LAMBDA(LET(t,TEXTSPLIT(SheetName()," "),DATE(INDEX(t,2),MONTH(INDEX(t,1)&("-1")),1)))
wDays=LAMBDA(WORKDAY.INTL(Date1()-1,SEQUENCE(NETWORKDAYS(Date1(),EOMONTH(Date1(),0),Holidays)),,Holidays))
 
Upvote 0
Hi, if you are trying to return the following workday if the date in Z5 is a non working day, but just return the date that is in Z5 if it is already a working day then you could try:
=WORKDAY.INTL(Z5-1,1,1,'date calcs'!$F$5:$F$19)

If you're trying to do something else, then try to explain in words what it is you are trying to do.
Thank you. Apologies our system was offline so was unable to reply sooner. Have managed a workaround that seems to work.
 
Upvote 0
Thank you. Apologies our system was offline so was unable to reply sooner. Have managed a workaround that seems to work.
 
Upvote 0
Review the following and review Excel's help files.
You can then adapt the information to your specific requirements.
You can post an extract of your sheet with the forum's tool named XL2BB.

T202401a.xlsm
ABCD
1Holidays
2Wed 20-Dec-2325-12-23
3Thu 21-Dec-2326-12-23
4Fri 22-Dec-2301-01-24
5Wed 27-Dec-23
6Thu 28-Dec-23
7Fri 29-Dec-23
8Tue 02-Jan-24
9Wed 03-Jan-24
3d
Cell Formulas
RangeFormula
A3:A9A3=WORKDAY.INTL(A2,1,1,Holidays)
Named Ranges
NameRefers ToCells
Holidays='3d'!$D$2:$D$4A3:A9
Thank you. Apologies our system was offline so was unable to reply sooner. Have managed a workaround that seems to work.
I do like the concept of using Lambda, haven't tried it out yet but am definitely going to give it a go so that my knowledge in this area increases
 
Upvote 0
Thanks for the feedback.
It is good to hear that you solved your challenge. What workaround did you use?

Dave
 
Upvote 0
Thanks for the feedback.
It is good to hear that you solved your challenge. What workaround did you use?
I cheated. Simply grabbed the spreadsheet that I have been using, renamed it and then deleted the data, and changed the tab year to 2024 and 2025. Dates seemed to have copied over successfully.
Oddity is that I can type in exactly the same formula in a new spreadsheet, but will not recognize the holidays, when saved in the new spreadsheet.
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,111
Members
453,021
Latest member
Justyna P

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