Return last working day of a month

mikeymay

Well-known Member
Joined
Jan 17, 2006
Messages
1,480
Is it possible to easily return get the last working day of the month for months where Mon-Fri are not the workdays?

I have a tool where the user will select the workdays (Mon-Fri, Mon-Sat, Tue-Sat, Tue-Sun, etc) and I need to show the last working day of each month also taking into account any bank holidays.


Thanks
 

Some videos you may like

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
Which version of Excel are you using?

XL2010 has Workday.INTL which you can specify the working days.
Example

=WORKDAY.INTL(A1,10,"1000001",Holidays)

That string "1000001" represents which days are working days / weekends.
Each number represents a day of the week, starting with MONDAY
1 = Weekend day
0 = Working day

so "1000001" makes Tuesday-Saturday working days

Hope that helps.
 

mikeymay

Well-known Member
Joined
Jan 17, 2006
Messages
1,480
I am using 2013 but I need it to be compatible with 2007 onward if possible
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
36,691
Office Version
  1. 2010
Platform
  1. Windows
I am using 2013 but I need it to be compatible with 2007 onward if possible
If you have the Analysis ToolPak add-in loaded in your copies of XL2007 (not needed for higher versions), you can use this formula...

=EOMONTH(A1,0)-MAX(0,WEEKDAY(EOMONTH(A1,0),2)-5)
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,122,910
Messages
5,598,803
Members
414,260
Latest member
joishe

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