LAMBDA · Date and time

Business days LAMBDA

xl.business.days counts weekdays between two dates and skips US federal holidays. January 5 through January 30, 2026 is 19 business days.

Microsoft 365, Excel 2024, and Excel for the web. Excel 2021 does not have LAMBDA.

Download the workbook

Syntax =xl.business.days(start, end)

xl.business.days
=LAMBDA(start,end,
  LET(
    first, MIN(start, end),
    last, MAX(start, end),
    y0, YEAR(first)-1,
    years, SEQUENCE(YEAR(last)-YEAR(first)+3, 1, y0, 1),
    holidays, VSTACK(
      MAP(years, LAMBDA(y, xl.us.holiday(y, "New Year"))),
      MAP(years, LAMBDA(y, xl.us.holiday(y, "MLK"))),
      MAP(years, LAMBDA(y, xl.us.holiday(y, "Presidents"))),
      MAP(years, LAMBDA(y, xl.us.holiday(y, "Memorial"))),
      MAP(years, LAMBDA(y, xl.us.holiday(y, "Juneteenth"))),
      MAP(years, LAMBDA(y, xl.us.holiday(y, "Independence"))),
      MAP(years, LAMBDA(y, xl.us.holiday(y, "Labor"))),
      MAP(years, LAMBDA(y, xl.us.holiday(y, "Columbus"))),
      MAP(years, LAMBDA(y, xl.us.holiday(y, "Veterans"))),
      MAP(years, LAMBDA(y, xl.us.holiday(y, "Thanksgiving"))),
      MAP(years, LAMBDA(y, xl.us.holiday(y, "Christmas")))
    ),
    IF(OR(NOT(ISNUMBER(start)), NOT(ISNUMBER(end))), NA(), NETWORKDAYS(start, end, holidays))
  )
)

Arguments

NameRequiredWhat to pass
startRequiredFirst date, as a real date serial. Both ends count when they are workdays. If this date is after the end, the count is negative, the same sign NETWORKDAYS returns.
endRequiredLast date. Build it with DATE, or type it so the cell holds a serial. Text that only looks like a date returns

Examples

Monday, January 5, 2026 through Friday, January 30, 2026

=xl.business.days(DATE(2026,1,5), DATE(2026,1,30))

Result 19

A 10-workday task that includes the start, January 5 through January 16, 2026

=xl.business.days(DATE(2026,1,5), DATE(2026,1,16))

Result 10

Thursday, July 2, 2026 through Monday, July 6, 2026

=xl.business.days(DATE(2026,7,2), DATE(2026,7,6))

Result 3

Thursday, December 24, 2026 through Monday, January 4, 2027

=xl.business.days(DATE(2026,12,24), DATE(2027,1,4))

Result 6

=NETWORKDAYS(B1,B2,B3)B4
January 2026
AB
1Start1/5/2026
2End1/30/2026
3Holiday1/19/2026
4Business days19
A picture of the sheet, not a live calculator. January 19, 2026 is the only federal holiday inside this span. Both ends count.

xl.business.days counts workdays from one date through another. Saturday and Sunday are out. So are the eleven US federal holidays from xl.us.holiday. January 5 through January 30, 2026 is 19 business days. Martin Luther King Jr. Day, Monday, January 19, is the holiday inside that span. Without it the count is 20.

Both ends count when they are workdays. That is the NETWORKDAYS rule. How to add business days to a date in Excel, skipping holidays uses the other question, WORKDAY, which does not count the start. A 10-workday task that includes January 5 ends on January 16. This name, from January 5 through January 16, returns 10.

The dates are the legal holidays. OPM’s 2026 holiday schedule lists the day most federal employees are off, which moves when the legal date is a weekend. Section 6103(a) of title 5 of the United States Code is the legal date. This name uses that date. It does not move a Saturday back to Friday or a Sunday forward to Monday. How to list 2027 US federal holidays in Excel is the observed-day list.

Add it to the workbook

Copy the formula in the block above, including the line breaks. The formula calls xl.us.holiday, so that name has to exist in the same workbook. Its formula is on the US holiday page. Choose Formulas, Name Manager, New. Set the scope to Workbook. Create xl.us.holiday first, then xl.business.days. Excel Labs can do the same step: open the Advanced Formula Environment, add both names, and save them back to the workbook. A cell then calls =xl.business.days(...).

The sample workbook, with both names already saved, is business-days.xlsx. Its Business days column is NETWORKDAYS against the Holidays sheet, which is the Excel 2021 version of the same count for 2025 through 2028. In Microsoft 365 that column can be =xl.business.days(B5,C5).

The names need Microsoft 365, Excel 2024, or Excel for the web. Excel 2021 returns #NAME? for LAMBDA even when it already has XLOOKUP, FILTER, or LET. Excel 2021 can keep the holiday dates on a sheet and pass that range to NETWORKDAYS. The sample’s Holidays sheet builds them with DATE, WEEKDAY, and EOMONTH. Birthday of Martin Luther King, Jr., in the year stored in B1, is:

=DATE(B1,1,1)+MOD(2-WEEKDAY(DATE(B1,1,1),1)+7,7)+14

The count, with the eleven dates for each year laid out in Holidays!B2:E12, is:

=NETWORKDAYS(B5,C5,Holidays!B2:E12)

That grid in the sample covers 2025, 2026, 2027, and 2028. The name itself takes whatever years the two dates need.

How it works

The earlier date and the later date set the years. The list starts the year before the earlier date and runs through the year after the later date, so a holiday on December 31 or January 1 is on the list when the span crosses it. For each of those years the name calls xl.us.holiday once for each of the eleven keys: New Year, MLK, Presidents, Memorial, Juneteenth, Independence, Labor, Columbus, Veterans, Thanksgiving, and Christmas. NETWORKDAYS then drops Saturday, Sunday, and any of those dates that land on a weekday inside the span.

January 5, 2026 is a Monday. January 30 is a Friday. The weekdays run the 5th through the 9th, the 12th through the 16th, the 19th through the 23rd, and the 26th through the 30th. That is 20 days. January 19 is one of them, so the count is 19. New Year’s Day is January 1, which is outside this span.

July 2 through July 6, 2026 is Thursday, Friday, and Monday. July 4 is Saturday and July 5 is Sunday. The legal Independence Day does not remove Friday, July 3. November 23 through November 27, 2026 is 4. Thanksgiving, Thursday, November 26, is the day removed.

December 24, 2026 through January 4, 2027 crosses the year. Christmas is Friday, December 25. New Year’s Day 2027 is Friday, January 1. After those two Fridays and the two weekends, the remaining days are December 24, 28, 29, 30, and 31, and January 4. That is 6.

Limits

The weekend is Saturday and Sunday. A business that closes Friday and Saturday needs NETWORKDAYS.INTL and a weekend string. This name does not take one. State holidays, the Friday after Thanksgiving, and a company shutdown are not in the eleven-name list. Inauguration Day is not in it either.

A Saturday or Sunday legal date does not close the adjacent weekday. July 4, 2026 falls on Saturday. xl.us.holiday(2026, "Independence") returns July 4, and this count still includes Friday, July 3. Put July 3 in a holiday range of your own when that Friday is the day the office closes. The PTO tracker is a separate workbook. Its sample list includes Friday, July 3, 2026, so July 1 through July 10 is not the same hour count as the 8 weekdays this name returns for that span.