Formulas & Math 8 min read

The Master Guide to Date and Time Formulas in Excel

Master spreadsheet date arithmetic, dynamic timestamps (TODAY/NOW), project workdays (WORKDAY), milestone intervals, and DATEDIF calculations.

Interactive Guide: Follow along with the Student Gradebook & Analytics template.
Open

Dates in spreadsheets are a frequent source of confusion for beginners. A cell might display what looks like a text string — such as "2026-09-07" or "09/07/2026".

However, under the hood, the calculation engine does not see letters or words. It sees a single integer: a continuous serial number counting the days elapsed since January 1, 1900.

  • Day 1 is January 1, 1900.
  • Day 2 is January 2, 1900.
  • Day 46272 is September 7, 2026.

The Superpower of Date Math

Because dates are simply integers in disguise, you don't need complex formulas to add calendar days. You can perform direct math:

=InvoiceDate + 30

If InvoiceDate is 2026-09-07, adding +30 adds exactly 30 calendar days to return 2026-10-07 (your Net-30 payment deadline)!

How Time Works: Fractional Decimals

Time is stored as the decimal fraction of a 24-hour day:

  • 0.25 = 6:00 AM (one-quarter of a day)
  • 0.50 = 12:00 PM (noon, half a day)
  • 0.75 = 6:00 PM (three-quarters of a day)

In the ExcelClash Spreadsheet Editor, our client-side engine calculates dates and times with sub-millisecond precision directly on your computer.

Dynamic Live Timestamps: TODAY vs NOW

When managing operational trackers, invoices, or project milestones, you need formulas that know what today's date is without manually re-typing it every morning.

1. The TODAY() Function (Live Calendar Date)

TODAY returns the current calendar date without a timestamp:

=TODAY()

Real-World Invoice Aging Formula:

To calculate how many days overdue an unpaid invoice is:

=TODAY() - DueDateCell

If an invoice was due on August 15 and today is September 7, the formula automatically outputs 23 days overdue. Tomorrow, it will automatically update to 24 without touching the sheet!

2. The NOW() Function (Live Date + Timestamp)

NOW returns both the current date and the exact current time:

=NOW()

Ideal for logging transaction timestamps or building live time-tracking audit sheets.

Deconstructing & Rebuilding Dates (YEAR, MONTH, DAY, and DATE)

When analyzing sales trends, you often need to isolate specific parts of a date or construct valid dates programmatically:

1. Extracting Date Components

  • YEAR: =YEAR(A2) → Returns 2026
  • MONTH: =MONTH(A2) → Returns 9 (September)
  • DAY: =DAY(A2) → Returns 7

2. The Safe Assembly Rule with the DATE Function

One of the most dangerous traps in international business is formatting confusion: in the United States, 04/05/2026 means April 5th, but in the UK and Europe, it means May 4th!

To construct a date with 100% guarantee that it will never be misinterpreted by any spreadsheet software, always use the DATE function:

=DATE(year, month, day)

Example: Building the First Day of Next Month:

=DATE(YEAR(A2), MONTH(A2) + 1, 1)

Takes the year from A2, adds 1 to the month, and sets the day to 1. If A2 is in September 2026, it outputs 2026-10-01 reliably.

Business Workdays & Project Milestones (WORKDAY & NETWORKDAYS)

A standard calendar week has 7 days, but your team only works 5. If you promise a client a delivery in "10 days" and simply add +10 to a Friday start date, you land on a Monday — accidentally counting 4 weekend days where no work occurred!

Spreadsheets provide two specialized business scheduling functions:

1. WORKDAY (Calculate Target Delivery Date)

Adds working business days to a start date, automatically skipping Saturdays and Sundays:

=WORKDAY(StartDate, 10, [Holidays])
  • StartDate (A2): The project kickoff date.
  • Days (10): Number of business days required.
  • [Holidays] ($F$2:$F$10): An optional range of company or national holiday dates to skip.

2. NETWORKDAYS (Calculate Total Billable Working Days)

Computes the exact number of working days between two milestone dates:

=NETWORKDAYS(StartDate, EndDate, [Holidays])

Essential for calculating consultant billable days, payroll hours, and project sprint durations.

Contract Renewals & Month-End Deadlines (EDATE & EOMONTH)

Adding calendar months is tricky because months have 28, 29, 30, or 31 days. Never add +30 when calculating monthly subscription renewals!

1. EDATE (Add Exact Calendar Months)

EDATE jumps forward or backward by an exact number of calendar months:

=EDATE(StartDate, 12)       // Adds 12 months for 1-year SaaS contract renewal
=EDATE(StartDate, 3)        // Adds 3 months for quarterly review
=EDATE(StartDate, -1)       // Subtracts 1 month

If StartDate is 2026-01-31, =EDATE(StartDate, 1) cleanly calculates 2026-02-28.

2. EOMONTH (Snap to End of Month)

EOMONTH calculates the exact last day of the current, past, or future month:

=EOMONTH(StartDate, 0)      // Last day of current month (e.g. Sept 30)
=EOMONTH(StartDate, 1)      // Last day of next month (e.g. Oct 31)

Ideal for accounting month-end closing schedules and payroll tax due dates.

Calculating Exact Completed Intervals with DATEDIF & Hourly Billing

When calculating employee tenure, equipment depreciation, or customer age, you need to know how many full completed years or months have passed.

The DATEDIF Function

=DATEDIF(start_date, end_date, "unit")
  • Completed Years ("Y"):
=DATEDIF(HireDate, TODAY(), "Y") // Returns full years of employee tenure
  • Completed Months ("M"):
=DATEDIF(StartDate, EndDate, "M") // Returns completed months
  • Remaining Months After Completed Years ("YM"):
=DATEDIF(HireDate, TODAY(), "Y") & " Years, " & DATEDIF(HireDate, TODAY(), "YM") & " Months"

Outputs: "3 Years, 4 Months".

Calculating Hourly Billing & Time Differences

Because time is a decimal fraction of a 24-hour day, subtract the start time from the end time and multiply by 24:

=(EndTime - StartTime) * 24

If StartTime is 9:00 AM and EndTime is 5:30 PM, (17.5 - 9.0) = 0.3541 * 24 = 8.5 billable hours.

The Date Troubleshooter's Guide & 10-Function Cheat Sheet

How to Fix Common Date Errors

  1. 1The ##### Overflow: When a cell displays #####, it usually means the column is simply too narrow to display the formatted date, or a formula resulted in a negative date serial. Double-click the column header edge to expand width.
  2. 2The #VALUE! Error on Text Dates: If dates imported from a CSV fail in math formulas, wrap them in =DATEVALUE(A2) to force the engine to convert the text string into a true date serial.

The 10 Essential Date Functions Quick Reference

  • TODAY(): Current calendar date
  • NOW(): Current date and live timestamp
  • DATE(y, m, d): Bulletproof date constructor
  • YEAR(d) / MONTH(d) / DAY(d): Component extraction
  • WORKDAY(d, days): Project milestone skipping weekends
  • NETWORKDAYS(d1, d2): Total working days between dates
  • EDATE(d, m): Exact calendar month shifts
  • EOMONTH(d, m): Month-end closing date
  • DATEDIF(d1, d2, "Y"): Completed years/months tenure
Key Takeaways & Quick Reference
  • Always use the =DATE(year, month, day) function to assemble dates and avoid international date format confusion.
  • Use =WORKDAY() instead of simple addition (+) to ensure project delivery dates fall on real working business days.
  • Calculate billable hours from timestamps with =(EndTime - StartTime) * 24.
Live Interactive Sandbox

Test This Formula in the Playground

Launch the client-side spreadsheet engine and experiment with formulas with real-time feedback.

Launch Playground