Excel and Google Sheets Date Formula Generator

Choose what you want to work out, enter your cells, and copy the formula.

Formula

=A2+30

Moves the date in the start cell 30 days forward. Format the result cell as a date, or it shows a serial number.

  • 2 Apr 2027 result with A2 = 3 Mar 2027

How to use it

  1. Pick the task, then type the cell that holds your date, such as A2.
  2. Copy the formula and paste it into a cell. Drag it down to fill the column.
  3. Format the result cell as a date or a number, as the note says.

All the date formulas

TaskFormula
Add or subtract days=A2+1
Add or subtract months=EDATE(A2,1)
Add or subtract years=EDATE(A2,12)
Add or subtract working days=WORKDAY(A2,1)
Last day of a month=EOMONTH(A2,1)
First day of a month=EOMONTH(A2,0)+1
Days between two dates=DAYS(B2,A2)
Working days between two dates=NETWORKDAYS(A2,B2)
Complete years between two dates=DATEDIF(A2,B2,"Y")
Complete months between two dates=DATEDIF(A2,B2,"M")
Age in years from a birth date=DATEDIF(A2,TODAY(),"Y")
Days until a date from today=A2-TODAY()
Name of the weekday=TEXT(A2,"dddd")
Is the date a weekend?=WEEKDAY(A2,2)>5
ISO week number=ISOWEEKNUM(A2)
Day of the year=A2-DATE(YEAR(A2),1,1)+1
Is it a leap year?=MONTH(DATE(YEAR(A2),2,29))=2

Questions people ask

Do these formulas work in both Excel and Google Sheets?

Yes. Every formula here uses functions that both programs have, with the same arguments.

Why does my result show a number like 46449?

Spreadsheets store a date as a count of days. Format the result cell as a date. Some results, such as days between two dates, should be formatted as a number.

Why does my spreadsheet want semicolons?

In some regional settings, such as much of Europe, the argument separator is a semicolon. Pick "Semicolon" in the generator and the formula will use it.

Why is DATEDIF missing from the Excel function list?

Excel does not list it in the function wizard, but it works when you type it. Google Sheets documents it. The "M" and "Y" units count a month or year only when the end date reaches the start date's day of the month.

How do I skip public holidays?

WORKDAY and NETWORKDAYS take a list of holiday dates as an extra argument. Put the dates in a range, then add it at the end, for example =WORKDAY(A2,10,$F$2:$F$12).

Does the example result come from a spreadsheet?

No. We work it out with our own tested date engine, following each function's documented rules. Excel starts its dates in 1900, so example dates before March 1900 are not accepted.

Related tools

Last updated By Sufian Majid Sources: DATEDIF function (Microsoft), NETWORKDAYS function (Microsoft), WORKDAY function (Microsoft), EDATE function (Microsoft), DATEDIF (Google Docs Editors Help), ISOWEEKNUM (Google Docs Editors Help)