Excel 2019 Bible

(singke) #1

Part II: Working with Formulas and Functions


FIGURE 12.2
Calculating the number of workdays between two dates

This formula is fairly straightforward. The NETWORKDAYS function has two required argu-
ments: a start date and an end date. If your start date is in cell B4 and your end date is
in cell C4, this formula would return the number of workdays (excluding Saturdays and
Sundays):
=NETWORKDAYS(B4,C4)

Using NETWORKDAYS.INTL
The one drawback to using the NETWORKDAYS function is that it defaults to excluding
Saturday and Sunday. But what if you work in a region where the weekends are actually
Fridays and Saturdays? Or worse yet, what if your weekends only include Sundays?

Excel has you covered with the NETWORKDAYS.INTL function. In addition to the required
start and end dates, this function has an optional third argument—a weekend code. The
weekend code allows you to specify which days to exclude as a weekend day.

As you enter the NETWORKDAYS.INTL function, Excel displays a menu as soon as you go
into the third argument (see Figure 12.3). Simply select the appropriate weekend code and
press Enter.

FIGURE 12.3
NETWORKDAY.INTL allows you to specify which days to exclude as weekend days.

Generating a list of business days excluding holidays
When creating dashboards and reports in Excel, it’s often useful to have a helper table that
contains a list of dates that represent business days (that is, dates that are not weekends or
holidays). This kind of a helper table can help assist in calculations like revenue per busi-
ness day, units per business day, and so on.
Free download pdf