Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, and 2013. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Calculating the First Business Day of the Month.
by Allen Wyatt
(last updated October 25, 2014)
Dan is setting up a worksheet for use in his company and needs a way to calculate the first business day of a calendar month. He knows how to calculate the first day of a month, but that day could possibly fall on a weekend or on a holiday.
The easiest way to calculate the first weekday of a given month is to use the WORKDAY function, in this way:
This formula finds the first weekday of the month of whatever date is in cell A1. The EOMONTH function returns the last day of the month prior to the date in cell A1, and then the WORKDAY function returns the first weekday in the following month.
The function is put together like this (using EOMONTH) because WORKDAY is a bit quirky; it assumes that the first parameter is a valid work day. This means that it doesn't check whether the date used in the parameter falls in the Monday through Friday work week. By forcing the parameter to be a day before the month in which you want to determine the first work day and setting the second parameter to 1, the function returns the first actual weekday for the desired month.
The WORKDAY function also allows you to optionally specify that holidays should be taken into account. The easiest way to do this is to set up a list of holiday dates, in a cell range, and then name that range. (How you name a range is discussed in other issues of ExcelTips.) If you give the range a name such as MyHolidays, then you can use the following version of the formula:
=WORKDAY(EOMONTH(A1,-1), 1, MyHolidays)
Here's a neat trick if you want to calculate the beginning work day for any given month in a year. Assume that cell A1 contains a year, such as 2011, and that cell A2 contains a month number, 1 through 12, representing the month for which you want the beginning work day. You can then use this formula to get the desired date:
=WORKDAY(DATE(A1,A2,0), 1, MyHolidays)
The way the DATE function is used in this formula returns the last day of the month prior to the month and year specified in cells A2 and A1. The second parameter for WORKDAY (1) then moves forward to the next workday. MyHolidays (as before) accounts for any holidays that may occur in that month.
The WORKDAY function works just fine for dates withing the US, but it gets a bit dicier if you need workdays in other countries. In that case, try using the WORKDAY.INTL function (introduced starting with Excel 2010) to see if it will do the trick for you. It is much more flexible in how it allows the designation of weekends and holidays.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10201) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel here: Calculating the First Business Day of the Month.
Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!
Want to add an ordinal suffix to a number, as in 2nd, 3rd, or 4th? Excel doesn't provide a way to do it automatically, ...Discover More
When working with dates, you may need to figure out all the dates on which weeks end in a given year. There are several ...Discover More
When you load data into Excel that was created in other programs, the formatting used for some types of data (such as ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.