Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. 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: Specifying Different Weekends with NETWORKDAYS.

Specifying Different Weekends with NETWORKDAYS

Written by Allen Wyatt (last updated January 21, 2023)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021


Sunil can use the NETWORKDAYS function to return the number of regular business days between two dates. The function assumes that Saturday and Sunday are not work days, but in Sunil's organization only Sunday counts as a non-work day. He wonders if there is a way to use NETWORKDAYS and specify that only Sunday should be excluded from the count returned.

You can determine this by using a formula based on the NETWORKDAYS function. Assuming that the starting date is in A1 and the ending date is in B1, the following formula examines the days between the two dates and essentially return a count of non-Sunday days in that range:

=NETWORKDAYS(A1,B1)+SUMPRODUCT(--(WEEKDAY
(ROW(INDIRECT(A1&":"&B1)))=7))

Of course, since Sundays are the only day of the week being excluded, you could simply skip the use of NETWORKDAYS and use SUMPRODUCT to figure out if the day should be counted or not:

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&B1)))>1))

If you expect that there may be holidays in the range, and that those holidays are in the named range “holidays,” then you'll need to go back to using NETWORKDAYS in the formula:

=NETWORKDAYS(A1,B1,holidays)+SUMPRODUCT(--
(WEEKDAY(ROW(INDIRECT(A1&":"&B1)))=7),--
(NOT(ISNUMBER(MATCH(ROW(INDIRECT(A1&":"&B1))
,holidays,0)))))

Of course, if you are using Excel 2010 or later, you can use the NETWORKDAYS.INTL function, which does more than the older NETWORKDAYS function. The biggest difference between the two is that NETWORKDAYS.INTL allows you to specify how the function should handle weekends. So, for instance, in Sunil's case where only Sundays should be considered "the weekend," you could use the following formula:

=NETWORKDAYS.INTL(A1,B1,11,Holidays)

Note that the only difference between this and full version of the NETWORKDAYS function is the inclusion of a new third parameter. In this case, the value 11 indicates that only Sundays should be considered weekends, but you could use any other the other parameter values, depending on your needs.

Number Weekend Days
1 Saturday, Sunday
2 Sunday, Monday
3 Monday, Tuesday
4 Tuesday, Wednesday
5 Wednesday, Thursday
6 Thursday, Friday
7 Friday, Saturday
11 Sunday
12 Monday
13 Tuesday
14 Wednesday
15 Thursday
16 Friday
17 Saturday

You can perform other magic with NETWORKDAYS.INTL, as well, but that is best left to different ExcelTips.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12450) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. You can find a version of this tip for the older menu interface of Excel here: Specifying Different Weekends with NETWORKDAYS.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Formatting All Headings At Once

If you need to apply a common formatting change to all the headings in your document, a quick way to do it is to use the ...

Discover More

Getting Rid of Spaces in Cells

Importing data into Excel that was generated in other programs can have some interesting side effects. For instance, you ...

Discover More

Summing Only Cells Containing Formulas

If you want to figure out the sum of all cells that contain formulas, there are a couple of ways you can go about it. ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More ExcelTips (ribbon)

Inserting Tomorrow's Date

You can use a couple of different worksheet functions to enter today's date in a cell. What if you want to calculate ...

Discover More

Copying Dates a Year Into the Future

Need to copy a range of dates and update them to a different year? Here are a number of ways to accomplish this task with ...

Discover More

Finding the Dates for Minimums and Maximums

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
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 6 - 0?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

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.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.