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: Specifying Different Weekends with NETWORKDAYS.

# Specifying Different Weekends with NETWORKDAYS

by Allen Wyatt
(last updated November 4, 2017)

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 the latest versions of Excel (beginning with Excel 2010), 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(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 indciates 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, and 2016. 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

An Automatic Two Spaces after a Period

Should you put two spaces after a sentence or just one? Ask different people and you will get different answers. To Word ...

Discover More

Merging Cells to a Single Sum

One way to make your worksheets less complex is to get rid of detail and keep only the summary of that detail. Here's how ...

Discover More

WordTips is a weekly newsletter that provides tips on how to best use Microsoft's word processing software. At ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

##### More ExcelTips (ribbon)

Unique Date Displays

Need to print an elapsed date in a strange format? It's easier to do than may appear at first glance. Here's a discussion ...

Discover More

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

Converting an Unsupported Date Format

Excel makes it easy to import information created in other programs. Converting the imported data into something you can ...

Discover More
##### Subscribe

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

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}] 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 eight less than 8?

2017-11-19 10:07:07

Alan Pink

Having introduced the NETWORK.INTL function, the last formula should be:
=NETWORKDAYS.INTL(A1,B1,11,Holidays)

##### 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.