First Workday of the Month

30percent

Board Regular
Joined
May 5, 2011
Messages
123
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I have seen many articles or posts on the internet that using the following formula, I could get the first workday of the month.

=WORKDAY(DATE(YEAR(TODAY()),MONTH(TODAY()),1)-1,1)

However, the result of the formula is 43040. It doesn't make sense to me. Do I need to convert it first before I get say a day between 1st to 3rd?

Thank you!
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
You need to format the cell as a date. Right click, format cells - select one of the date formats and 43040 will give you November 1st.
 
Upvote 0
Excel dates are just numbers formatted to be dates. Format the cell as a date and you will see that 43040 is 11/1/17.
 
Upvote 0
Hi,

thank you!

it works.

I wanted use the formula in VBA. I tried this
Code:
this_Month = application.WorksheetFunction.WorkDay(DATE(YEAR(TODAY()),MONTH(TODAY()),1)-1,1)
but somehow this is not working. Wonder if someone could help.
 
Upvote 0
VB-wise, try this:

Code:
Dim this_Month As Date
this_Month = WorksheetFunction.WorkDay(Date - Day(Date), 1)
 
Upvote 0
Adding to what Barry stated for the formula, in VBA try....

Code:
Sub xxxx()
Dim this_Month As Date
this_Month = WorksheetFunction.WorkDay(WorksheetFunction.EoMonth(Date, -1), 1)
Range("a1") = this_Month
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,764
Messages
6,180,841
Members
453,001
Latest member
coulombevin

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