Excel and Google Sheets Date Formulas With 2027 Examples
Spreadsheet date maths goes wrong in a few predictable places: counting both end dates or neither, forgetting holidays, adding “one month” to January 31, and trusting DATEDIF’s “MD” unit. This guide is a cheat sheet for the date functions that Excel and Google Sheets share (NETWORKDAYS, WORKDAY, their .INTL versions, EDATE, EOMONTH, DATEDIF and ISOWEEKNUM), with every example worked on real 2027 dates and US federal holidays, so you can paste a formula and check you get the same answer. Each result below was calculated with the formula in LibreOffice Calc, which implements these functions to the same definitions, and checked against Microsoft’s documentation and an independent Python calculation.
At a glance
=end-startcounts days between and leaves out one end; add 1 to count both.NETWORKDAYScounts working days and includes both the start and end dates.WORKDAYmoves forward from the start date and does not count the start date itself.EDATE(Jan 31, 1)gives the last day of February, not March 3.- Microsoft does not recommend DATEDIF’s “MD” unit; there is a safer formula below.
Cheat sheet
Holidays in these examples are the 12 US federal holidays observed on weekdays in 2027, typed as dates in cells J1:J12 (list from our US holidays 2027 page).
| Task | Formula | Result |
|---|---|---|
| Weekdays in 2027 | =NETWORKDAYS(DATE(2027,1,1),DATE(2027,12,31)) |
261 |
| Working days in 2027 (US federal) | =NETWORKDAYS(DATE(2027,1,1),DATE(2027,12,31),J1:J12) |
249 |
| Working days in November 2027 | =NETWORKDAYS(DATE(2027,11,1),DATE(2027,11,30),J1:J12) |
20 |
| 10 working days after Fri Jan 15, 2027 | =WORKDAY(DATE(2027,1,15),10,J1:J12) |
Mon Feb 1, 2027 |
| 10 working days before Mon Mar 1, 2027 | =WORKDAY(DATE(2027,3,1),-10,J1:J12) |
Fri Feb 12, 2027 |
| Same date next month | =EDATE(DATE(2027,1,31),1) |
Feb 28, 2027 |
| Last day of a month | =EOMONTH(DATE(2027,2,10),0) |
Feb 28, 2027 |
| First day of a month | =EOMONTH(DATE(2027,5,20),-1)+1 |
May 1, 2027 |
| Days between two dates | =DATE(2027,12,25)-DATE(2027,1,15) |
344 |
| Same, counting both days | =DATE(2027,12,25)-DATE(2027,1,15)+1 |
345 |
| Whole years between (age) | =DATEDIF(DATE(1990,5,15),DATE(2027,3,1),"Y") |
36 |
| ISO week number | =ISOWEEKNUM(DATE(2027,1,1)) |
53 |
| Day name | =TEXT(DATE(2027,7,4),"dddd") |
Sunday |
Microsoft advises entering dates with the DATE function or as the result of other formulas, not as typed text, because text dates can be misread (Microsoft, NETWORKDAYS). That is why every example uses DATE(year,month,day).
Counting working days: NETWORKDAYS and NETWORKDAYS.INTL
NETWORKDAYS(start_date, end_date, [holidays]) counts Monday-to-Friday days from start to end, minus any dates in the holidays range. It includes both end dates: =NETWORKDAYS(DATE(2027,1,4),DATE(2027,1,8)), Monday to Friday of one week, returns 5. One working day on its own, such as Monday, January 4, 2027 to itself, returns 1. If the end date is before the start date, the result is negative (December 31 back to December 1, 2027 gives −23, or −21 with the J1:J12 holidays).
The holidays argument matters more than people expect. For 2027 it is the difference between 261 and 249 in the US: New Year’s Day, Martin Luther King Jr. Day, Presidents’ Day, Memorial Day, Juneteenth observed (Fri Jun 18), Independence Day observed (Mon Jul 5), Labor Day, Columbus Day, Veterans Day, Thanksgiving, Christmas observed (Fri Dec 24) and New Year’s Day 2028 observed (Fri Dec 31). Use your own employer’s list; see how many work hours are in 2027 for what changes when one is missing.
Other weekends
NETWORKDAYS.INTL(start, end, [weekend], [holidays]) lets you choose the weekend. According to Microsoft’s NETWORKDAYS.INTL page, weekend code 1 (the default) is Saturday-Sunday, 2 is Sunday-Monday, 7 is Friday-Saturday, 11 is Sunday only and 17 is Saturday only. You can also pass a seven-character string of 0s and 1s starting with Monday, where 1 means a day off: "0000011" is a Saturday-Sunday weekend.
- Friday-Saturday weekend, 2027:
=NETWORKDAYS.INTL(DATE(2027,1,1),DATE(2027,12,31),7)gives 260, one fewer than a Saturday-Sunday weekend because 2027 has 53 Fridays. - Six-day week (Sunday off): code 11 gives 313.
- Count one weekday: mark every other day as “weekend”.
=NETWORKDAYS.INTL(DATE(2027,1,1),DATE(2027,12,31),"1111011")returns 53, the number of Fridays in 2027."1011111"counts Tuesdays: 52.
Google Sheets has the same functions with the same arguments (Google Sheets function list; NETWORKDAYS in Sheets).
Adding working days: WORKDAY and WORKDAY.INTL
WORKDAY(start_date, days, [holidays]) returns the date that is a given number of working days after (or, with a negative number, before) the start date (Microsoft, WORKDAY). The start date itself is not counted, so “1 working day after Friday” is Monday:
=WORKDAY(DATE(2027,1,8),1)gives Monday, January 11, 2027.=WORKDAY(DATE(2027,11,24),2,J1:J12)gives Monday, November 29: it skips Thanksgiving (Thursday) and counts Friday, November 26 as a working day. If your office closes that Friday too, add it to the holiday list.=WORKDAY(DATE(2027,12,23),1,J1:J12)gives Monday, December 27, skipping Christmas observed and the weekend.- 30 working days after Friday, January 15, 2027 is Friday, February 26 without holidays, but Tuesday, March 2 with them (MLK Day and Presidents’ Day fall in between). That two-day gap is the kind of error a contract deadline cannot afford; our guide to counting days for a deadline covers the legal side.
WORKDAY.INTL adds the same weekend argument as NETWORKDAYS.INTL (Microsoft, WORKDAY.INTL). With a Friday-Saturday weekend, 1 working day after Thursday, December 30, 2027 is Sunday, January 2, 2028.
To check any of these without a spreadsheet, our business days calculator counts and adds working days with holidays for many countries.
Months and month-ends: EDATE and EOMONTH
EDATE(start_date, months) returns the same day of the month a number of months later (Microsoft, EDATE). When that day does not exist, the result is the last day of the target month (Microsoft’s page does not spell this out; we confirmed it with the formula and in Python):
=EDATE(DATE(2027,1,31),1)gives February 28, 2027.=EDATE(DATE(2028,1,31),1)gives February 29, 2028 (a leap year).=EDATE(DATE(2027,8,31),6)gives February 29, 2028.
So EDATE is not the same as adding 30 days: =DATE(2027,1,15)+30 gives February 14, 2027, while EDATE gives February 15. If a contract says “one month”, EDATE is usually the closer match; if it says “30 days”, add 30. Our guide to 30 days vs 1 month explains why the two differ.
EOMONTH(start_date, months) returns the last day of the month a number of months before or after the start date (Microsoft, EOMONTH). =EOMONTH(DATE(2027,11,15),3) gives February 29, 2028. Adding 1 to EOMONTH(date,−1) gives the first day of the date’s own month.
Age and elapsed time: DATEDIF, and its one bad unit
DATEDIF(start_date, end_date, unit) counts complete years (“Y”), complete months (“M”) or days (“D”), plus three “ignore” units: “YM” (months, ignoring years), “YD” (days, ignoring years) and “MD” (days, ignoring months and years). Microsoft’s DATEDIF page says Excel includes it to support older Lotus 1-2-3 workbooks, and warns: “We don’t recommend using the “MD” argument, as there are known limitations with it”, because it may give a negative number, a zero or an inaccurate result.
For someone born May 15, 1990, on March 1, 2027:
DATEDIF(...,"Y")= 36 yearsDATEDIF(...,"YM")= 9 months- The remaining days, without “MD”:
=end-EDATE(start,DATEDIF(start,end,"M"))= 14 days. This finds the last “monthiversary” with EDATE and counts days from there.
So the age is 36 years, 9 months and 14 days. Our age calculator works out exact ages without a formula.
Weeks and weekdays
- ISO week number:
=ISOWEEKNUM(date)(Microsoft, ISOWEEKNUM). January 1, 2027 is in ISO week 53 of 2026, and week 1 starts on Monday, January 4. PlainWEEKNUMreturns 1 for January 1, 2027, because by default it starts weeks on Sunday and counts the week containing January 1 as week 1. See ISO week numbers explained for the full comparison. - Weekday number:
=WEEKDAY(date,2)gives Monday = 1 to Sunday = 7. February 14, 2027 returns 7 (a Sunday). - Monday of the week:
=date-WEEKDAY(date,3)(type 3 counts Monday as 0). For Monday, February 1, 2027 it returns the same date. - The nth weekday of a month (for floating holidays): the fourth Thursday of November 2027 is
=DATE(2027,11,1)+MOD(4-WEEKDAY(DATE(2027,11,1),2),7)+21, which gives November 25 (Thanksgiving). The 4 is Thursday in WEEKDAY type 2; the +21 adds three more weeks.
Traps checklist
- Off by one. Subtraction excludes one end; NETWORKDAYS includes both; WORKDAY excludes the start. Decide which one your question needs before you write the formula.
- Missing or text holidays. Google’s help says the holidays range should contain dates or date serial numbers. A holiday entered as text may not be recognised as a date, so check one known holiday week by hand.
- Observed days. When a holiday falls on a weekend, the day off usually moves. In 2027, July 4 (Sunday) is observed Monday, July 5, and Christmas (Saturday) is observed Friday, December 24. List the observed dates, not the calendar dates.
- Month-end drift. Chaining EDATE month by month from January 31 gives February 28, then March 28. Always calculate from the original date (
EDATE(start, n)), not from the previous result. - The 1900 leap-year bug. Microsoft confirms Excel wrongly treats 1900 as a leap year, for compatibility with Lotus 1-2-3, and WEEKDAY gives wrong results for dates before March 1, 1900 (Microsoft Learn). It does not affect modern dates, but beware when working with historical data.
Frequently asked questions
Does NETWORKDAYS include the start date?
Yes, it counts both the start and end dates if they are working days. Monday to Friday of the same week returns 5.
How do I add business days to a date in Excel?
Use =WORKDAY(start, days, holidays). The start date is not counted, so 1 working day after a Friday is the following Monday.
Why does DATEDIF give strange results?
Usually because of the “MD” unit, which Microsoft says has known limitations. Use end-EDATE(start,DATEDIF(start,end,"M")) for the leftover days instead.
How do I count working days with a Friday-Saturday weekend?
Use NETWORKDAYS.INTL with weekend code 7, or the string “0000110”.
Do these formulas work in Google Sheets?
Yes. As of November 2026, Google Sheets includes NETWORKDAYS, NETWORKDAYS.INTL, WORKDAY, WORKDAY.INTL, EDATE, EOMONTH, DATEDIF, ISOWEEKNUM, WEEKNUM and WEEKDAY.
Sources and method
- Function definitions: Microsoft Support pages for NETWORKDAYS, NETWORKDAYS.INTL, WORKDAY, WORKDAY.INTL, EDATE, EOMONTH, DATEDIF, ISOWEEKNUM; Microsoft Learn, 1900 leap year. Google: Sheets function list, NETWORKDAYS.
- Every result: calculated by the formula in LibreOffice Calc and independently in Python; function behaviour checked against the Microsoft and Google pages above. US holiday dates as listed by OPM.
Last checked: November 8, 2026.