Written by Allen Wyatt (last updated September 1, 2018)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365
Joe wonders how to return the date of the previous workday, taking into account any holidays. He needs to be able to get this information on any particular date. This is rather easy; in fact, Excel has a function designed specifically for this purpose:
=WORKDAY(A1,-1,MyHolidays)
The WORKDAY function is used to determine dates for workdays, based upon adjustments that you specify. The first argument, A1, refers to the cell where the reference date is located. This information can be obtained in a couple of different ways. You can manually enter the date into cell A1 or you could use a formula in that cell to signify the date. For instance, you could use the following simple formula in cell A1 so that it always contains today's date:
=TODAY()
The second part of the formula, -1, says to subtract one day from the date in A1. The third part of the formula, MyHolidays, refers to a named range containing a list of dates and holidays you want skipped in determining the previous workday.
The WORKDAY function returns the date of day previous to the date entered in A1, allowing for any holidays.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (8106) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. You can find a version of this tip for the older menu interface of Excel here: Finding the Previous Work Day.
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!
Excel includes a large number of functions that can be used in evaluating the data in a worksheet. In this tip you learn ...
Discover MoreNeed to know how many days there are between two dates? It's easy to figure out—unless you need the figure in ...
Discover MoreNeed to know the number of months between two dates? It's easy to figure out if you use the DATEDIF function.
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2018-09-03 09:28:08
David Robinson
A brief note that if you work in a culture where the weekend isn't Saturday and Sunday, use the WORKDAY.INTL function instead, which has weekend specification options.
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.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2023 Sharon Parq Associates, Inc.
Comments