Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, and 2016. 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 Business Days.
by Allen Wyatt
(last updated May 5, 2017)
In performing calculations with Excel, it is often helpful to know how many days there are between two dates. Excel makes this easy—you just subtract the earlier date from the latter.
In a business environment, however, you may not want to know just the number of days—you probably want to know the number of business days between two dates. In other words, how many workdays are there between two dates?
Believe it or not, Excel makes it almost as easy to calculate business days as it is to calculate regular days. All you need to do is use the NETWORKDAYS worksheet function. Let's suppose for a moment that you had two dates: one in A3 and the other in A4. The date in A3 is your starting date and the date in A4 is the ending date. To calculate the work days between the two dates, you could use the following formula:
This returns a count of all the days between the two dates, not counting weekends. You should note that the function returns the number of full days. Thus, if your starting date was Sept. 4 and your ending date was Sept. 5, the function would return a value of 2. (Provided neither day was a weekend day.)
If you want to account for holidays, the easiest way is to enter your standard holidays in a range of cells, and then define a name for that range. (I always like the terribly obvious name of “Holidays.”) You can then alter the NETWORKDAYS formula in this manner:
Microsoft also introduced an expanded version of the NETWORKDAYS function in Excel 2010, but it has a different function name: NETWORKDAYS.INTL. The biggest difference between NETWORKDAYS.INTL and NETWORKDAYS is that NETWORKDAYS.INTL allows you to specify how the function should handle weekends. This new parameter goes right after the ending date parameter. So, for instance, if you wanted to know the number of work business days between the dates in A3 and A4 and you wanted to take holidays into account, you would use something like the following:
Note the addition of the "1" parameter in the third parameter position. The value you use here can be any of 14 values:
If that isn't flexible enough for you, NETWORKDAYS.INTL allows you to use a string for the third parameter that exactly specifies which days should be considered workdays and weekend days. So, for instance, let's say that your company uses a four-day workweek, Monday through Thursday. In this case, you could use a formula such as the following:
Note that the string in the third parameter position is exactly 7 digits long and represents the days of the week, Monday through Sunday. A 0 indicates that day is a workday and a 1 indicates it is a "weekend" day that should not be used in calculations.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12401) applies to Microsoft Excel 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Excel here: Calculating Business Days.
Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!
Given a starting date and an ending date, you may want to generate the names of all the months between those two dates. ...Discover More
Need a way to enter dates from every second Tuesday (or some other regular interval)? Excel makes it easy, providing ...Discover More
If you use Excel to maintain a collection of data, you may need to find information in one column based on information in ...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.