Sub topic 6
Adding and Subtracting Dates in Google Sheets
Assume you can enter formulas, use relative and absolute cell references, and change number formats from the Format menu. This chapter uses that knowledge to calculate elapsed time, add durations, and avoid confusing displayed dates with stored values.
The working model
Google Sheets stores a date as a serial number: a count of days from its date system. A time is the fractional part of a day. For example, 0.5 represents 12 hours, and 0.25 represents 6 hours.
When you subtract one date from another, Sheets subtracts their serial numbers. The result is a number of days.
| Formula | Result type | Meaning |
|---|---|---|
| `=B2-A2` | Number of days | Days from the date in A2 to the date in B2 |
| `=(B2-A2)*24` | Number of hours | Elapsed hours between two date-times |
| `=A2+7` | Date | Seven days after the date in A2 |
If the result appears as another date, change its format to Number. A duration should usually be formatted as a number or as a duration, not as a calendar date.
=B2 - A2If A2 contains June 10, 2026 and B2 contains June 15, 2026, the formula returns 5. Reversing the references returns -5, which indicates that the second date occurs before the first.
Adding dates and durations
Add a whole number to a date to move forward by that many days. Subtract a number to move backward.
=A2 + 14
=A2 - 3These formulas are useful for simple due dates. To add a time, convert hours or minutes to a fraction of a day:
=A2 + 6/24
=A2 + 90/(24*60)The first formula adds six hours. The second adds 90 minutes. If A2 contains both a date and a time, the result preserves both parts.
Date differences with date-times
For two date-time values, subtraction returns days including a fractional part.
=(B2 - A2) * 24
=(B2 - A2) * 24 * 60The first formula returns elapsed hours. The second returns elapsed minutes. For example, a difference of 1.5 days equals 36 hours.
The DAYS function makes the purpose clearer when you need whole calendar days:
=DAYS(B2, A2)It returns the same basic result as =B2-A2, but its argument order makes the start and end dates explicit.
Common errors
A negative result
A negative result means the end date is earlier than the start date. Check the cell references and confirm which date should come first.
A result displayed as a date
Sheets applies the result cell's number format. If a duration appears as a date in 1900 or another unexpected year, select the cell and choose Format > Number > Number or Duration.
Text that looks like a date
A value imported from another system may look like a date but still be text. Subtraction then produces an error or an unexpected result. Convert it first when needed:
=DATEVALUE(A2)Use DATEVALUE only when the text follows a format Sheets can parse under the spreadsheet's locale.
> callout warning > Do not subtract formatted labels such as June 10, 2026 after converting them with TEXT. TEXT returns text, not a date value. Keep the original date for calculations and use TEXT only for display labels.
A practical pattern
For a task tracker, place the requested date in A2 and the completion date in B2. Then calculate elapsed days in C2:
=IF(OR(A2="", B2=""), "", DAYS(B2, A2))The IF formula leaves C2 blank until both dates exist. This prevents incomplete rows from showing misleading values.
Exercise
A2 contains 2026-11-28 09:30, and B2 contains 2026-11-29 14:00. Write a formula that returns the elapsed time in hours.
Show answer
=(B2-A2)*24