✦ Free AI Tool

Date Formula Generator

Generate date and time formulas from plain English. Calculate days between dates, end of month, business days, add months. Free, no signup, works for Excel and Google Sheets.

Generate Formula Free → Back to Home
Date & Time Functions

What Are Date Functions?

Date functions in Excel and Google Sheets let you calculate differences between dates, find the end of a month, add months to a date, count business days, and much more. These functions are essential for project timelines, invoicing, payroll, age calculations, and any spreadsheet that tracks time-based data.

The most commonly used date functions are DATEDIF for date differences, EOMONTH for month-end, EDATE for adding months, WORKDAY and NETWORKDAYS for business day calculations, and TODAY / NOW for current dates and times.

Key Date Functions
=DATEDIF(start, end, unit) -- Difference between dates (Y, M, D) =EOMONTH(date, months) -- Last day of month (0 = current) =EDATE(date, months) -- Add/subtract months =WORKDAY(start, days, [holidays]) -- Date after N business days =NETWORKDAYS(start, end, [holidays]) -- Business days between dates =TODAY() -- Current date =NOW() -- Current date and time =WEEKDAY(date) -- Day of week (1=Sunday) =YEAR(date), MONTH(date), DAY(date) -- Extract components

How to Use This Generator

  1. Go to the ExcelForm tool on the homepage
  2. Click the Generate tab
  3. Describe your date calculation in plain English — be specific about start/end dates, what to count, and any holidays to exclude
  4. Select your environment (Excel, Google Sheets, or Both)
  5. Click Generate Formula and copy the result into your spreadsheet

Example: Date Formula Generator in Action

✎ What you type

"Calculate how many business days between the start date in A2 and end date in B2, excluding holidays in E2:E10."

✓ What ExcelForm generates

=NETWORKDAYS(A2,B2,$E$2:$E$10)

✎ What you type

"Find the last day of the month for the date in A2."

✓ What ExcelForm generates

=EOMONTH(A2,0)

Date Function Reference

DATEDIF
Calculate difference between two dates in years, months, or days. =DATEDIF(A2,B2,"Y")
EOMONTH
Get the last day of the month, or N months away. =EOMONTH(A2,0)
EDATE
Add or subtract months from a date. =EDATE(A2,3) adds 3 months.
NETWORKDAYS
Count business days between dates, excluding weekends and optional holidays. =NETWORKDAYS(A2,B2)
WORKDAY
Find the date N business days from a start date. =WORKDAY(A2,10)
TODAY / NOW
Current date (=TODAY()) or current date and time (=NOW()). These update automatically when the spreadsheet recalculates.
WEEKDAY
Return the day of the week as a number. =WEEKDAY(A2,2) returns 1 for Monday through 7 for Sunday.
YEAR, MONTH, DAY
Extract individual components from a date. =YEAR(A2), =MONTH(A2), =DAY(A2)

Common Mistakes to Avoid

DATEDIF — The Hidden Powerhouse

DATEDIF is one of Excel's most useful yet least-documented functions. Microsoft intentionally hides it from the function wizard, but it works in every version of Excel and Google Sheets. It calculates the complete difference between two dates in years, months, or days.

The unit argument controls what gets returned: "Y" for complete years, "M" for complete months, "D" for total days, "YM" for months excluding years, "MD" for days excluding months and years, and "YD" for days excluding years.

DATEDIF Examples
=DATEDIF(A2,TODAY(),"Y") -- Age in years =DATEDIF(A2,TODAY(),"M") -- Age in months =DATEDIF(A2,TODAY(),"D") -- Age in days =DATEDIF(A2,TODAY(),"YM") -- Months since last birthday =DATEDIF(A2,B2,"Y")&" years "&DATEDIF(A2,B2,"YM")&" months"

Working with Business Days, Holidays, and Time Zones

Calculating business days is one of the most common date tasks in professional spreadsheets. NETWORKDAYS counts weekdays (Monday-Friday) between two dates and optionally excludes holidays. WORKDAY finds a date N business days from a start date.

For custom weekend schedules (like Friday-Saturday in some countries), use NETWORKDAYS.INTL and WORKDAY.INTL which let you specify which days are weekends using a string code.

Business Day Formulas
=NETWORKDAYS(A2,B2) -- Basic business days =NETWORKDAYS(A2,B2,$E$2:$E$10) -- Exclude holidays =NETWORKDAYS.INTL(A2,B2,7) -- Custom weekends (Friday-Saturday) =WORKDAY(A2,10,$E$2:$E$10) -- Date 10 business days after start =WORKDAY.INTL(A2,10,1,$E$2:$E$10) -- With custom weekend + holidays
📖 Related Guide
Excel Formulas for Finance →

Generate Your Date Formula Free

Free AI formula generator — no signup, no credit card. 10 queries per day.
The only tool offering all 6 formula tools free without signup.

Generate Formula Free
Related Tools
Text Formula Generator IF Formula Generator Fix Broken Formula
FAQ

Frequently Asked Questions

How do I calculate days between two dates in Excel?
Subtract the earlier date from the later date: =B2-A2. For complete months, use DATEDIF: =DATEDIF(A2,B2,"M"). For complete years: =DATEDIF(A2,B2,"Y"). To exclude weekends, use NETWORKDAYS: =NETWORKDAYS(A2,B2).
What is the DATEDIF function in Excel?
DATEDIF calculates the difference between two dates in years, months, or days. Syntax: =DATEDIF(start_date, end_date, unit). Units: "Y" for years, "M" for months, "D" for days, "YM" for months excluding years, "MD" for days excluding months and years. Note: DATEDIF is not documented by Microsoft but works in all Excel versions.
How do I get the last day of the month?
Use EOMONTH: =EOMONTH(A2,0). The 0 means the end of the current month. For next month's end, use 1: =EOMONTH(A2,1). For the previous month's end, use -1. In Google Sheets, EOMONTH works identically.
How do I calculate business days between dates?
Use NETWORKDAYS to count business days excluding weekends: =NETWORKDAYS(A2,B2). To also exclude holidays, add a third argument with the holiday range: =NETWORKDAYS(A2,B2,$E$2:$E$10). For custom weekends (e.g., Friday-Saturday), use NETWORKDAYS.INTL.
How do I add months to a date in Excel?
Use EDATE: =EDATE(A2,3) adds 3 months. =EDATE(A2,-1) subtracts 1 month. EDATE handles month-end correctly — adding 1 month to January 31 gives February 28 (or 29 in a leap year).
Why does my date formula return a number instead of a date?
Excel stores dates as serial numbers (day 1 = January 1, 1900). If a cell is formatted as General or Number, dates display as numbers. Select the cell, press Ctrl+1, and choose Date format. The underlying value is correct — only the display format is wrong.
How do I calculate age from date of birth?
Use DATEDIF for accurate age: =DATEDIF(A2,TODAY(),"Y"). For age in years and months: =DATEDIF(A2,TODAY(),"Y")&" years "&DATEDIF(A2,TODAY(),"YM")&" months".
Is the date formula generator free?
Yes, completely free. 10 AI formula queries per day, no signup, no credit card required. Generate date formulas for Excel, Google Sheets, and Airtable.