Excel Formula: Get First or Last Workday in Month
To find the first or last workday of month in the given date, you can use the formulas that combine the several functions.
If you want to follow along with this tutorial, please download the example spreadsheet.
Get the first workday in month
Generic formula:
WORKDAY(DATE(YEAR(date),MONTH(date),1)-1,1) |
Syntaxt and Arguments
Date: the date that you want to get the first workday of its month. |
Return Value
The formula returns to a 5-digit serial number, you can format the result as date format for more directly viewing.
How this formula works
Cell B3 contains the date that you need to get the first workday of the month, please use below formula:
=EOMONTH(B3,-2)+1 |
Press Enter key to get the first serial number, then drag auto fill handle over the cells which need this formula.
Keep the results selected, click the arrow in the Number Format textbox under Home tab, in the expand drop-down list, choose Short Date or Long Date to format the results as dates.
Explanation
MONTH function: gets the month as integer number (1 to 12) from date.
YEAR function: returns the year based on the given date in a 4-digit serial number format.
DATE function: creates date with year, month and day.
WORKDAY function: adds workdays to the given start date and returns a workday.
=WORKDAY(DATE(YEAR(B3),MONTH(B3),1)-1,1)
=WORKDAY(DATE(YEAR(B3),3,1)-1,1)
=WORKDAY(DATE(2020,3,1)-1,1)
=WORKDAY("2/29/2020",1)
=3/2/2020
Get the last workday in month
Generic Formula
WORKDAY(EOMONTH(date,0)+1,-1) |
Syntax and Arguments
Date: the date that you want to get the last workday of its month. |
Return Value
The formula returns to a 5-digit serial number, you can format the result as date format for more directly viewing.
How the formula works
For instance, the Cell B3 contains the date that you need to get the last workday of the month, please use below formula:
=WORKDAY(EOMONTH(B3,0)+1,-1) |
Press Enter key to get the first serial number, then drag auto fill handle over the cells which need this formula.
Keep the results selected, click the arrow in the Number Format textbox under Home tab, in the expand drop-down list, choose Short Date or Long Date to format the results as dates.
Explanation
EOMONTH function: gets the last day of month in future or past.
WORKDAY function: adds workdays to the given start date and returns a workday.
=WORKDAY(EOMONTH(B3,0)+1,-1)
=WORKDAY("4/1/2020",-1)
=3/31/2020
Relative Formulas
- Get date from given date month year
The DATE function can be used to get a standard date based on the given year, month and day in Excel. - Find earliest or latest date in each group
This article provides the formulas to find the earlist and lates dates in the same group in Excel. - Get day name from given date
This tutorial talks about how to use formula to get the day name such as Monday,Tuesday based on the given date. - Create weekly date range
In this tutorial, it provides a formula to quickly get the weekly date range in Excel.
Relative Functions
- Excel DATE Function
Create date with year, month and day - Excel YEAR Function
Returns the year of date in 4-digit serial number format - Excel MONTH Function
The MONTH is used to get the month as integer number (1 to 12) from date - Excel DAY Function
DAY function gets the day as a number (1 to 31) from a date - Excel NOW Function
Get the current time and date
The Best Office Productivity Tools
Kutools for Excel - Helps You To Stand Out From Crowd
Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...
Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)
- One second to switch between dozens of open documents!
- Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
- Increases your productivity by 50% when viewing and editing multiple documents.
- Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.