Sub topic 1
How Sheets stores dates and times
Google Sheets stores dates and times as serial numbers: numbers that count elapsed days from a starting date. A whole number represents a date. A decimal fraction represents a time during that date.
For example, a date-time value might look internally like this:
| Stored value | Meaning |
|---|---|
| 46000 | A date at midnight |
| 46000.5 | The same date at noon |
| 46000.25 | The same date at 6:00 AM |
You usually see a formatted date instead of the serial number. The stored value remains numeric, so formulas can compare, add, subtract, and sort date-time values.
Prerequisites
You should know how to enter values and formulas, use relative and absolute cell references, and apply number formats from the Format menu.
Dates are numbers
A date is a count of days. Subtracting one date from another gives the number of days between them:
=B2 - A2If A2 contains January 1 and B2 contains January 8, the result is 7. Format the result as a number if you want to display the duration clearly.
A time is a fraction of one day. Since one day has 24 hours, multiplying a date-time difference by 24 converts days to hours:
=(B2 - A2) * 24For example, a difference of 0.5 days is 12 hours. A difference of 0.0208333 days is about 30 minutes.
Formats change the display
The same stored number can appear in several ways:
| Format | Example display |
|---|---|
| Date | 11/28/2026 |
| Custom date | 2026-11-28 |
| Date and time | 11/28/2026 14:30:00 |
| Number | 46354.60417 |
Changing the format changes the display, not the underlying value. This explains why a formula can show a decimal when you expected a date. Select the cell, then choose Format > Number > Date or Custom date and time.
You can inspect a value by temporarily applying the Number format. If a valid date becomes a number with a fractional part, Sheets is storing both a date and a time.
Creating a reliable date value
Use DATE when you have separate year, month, and day numbers:
=DATE(2026, 11, 28)This creates a real date value without relying on how date text is interpreted. That matters when a spreadsheet uses a different locale, such as day-month-year instead of month-day-year.
The same model applies to date-time values. A date is the whole-number portion, and the time is the fractional portion. Date and time functions can work with these components because they operate on the numeric value.
Check the underlying value
Enter a date in A2, duplicate it into B2, and format B2 as a number. Compare the result with a date-time value. The date-time value has a decimal because it includes part of a day.
Do not round or replace the serial number just to change its appearance. Apply a number format instead. Rounding can remove the time portion and change later calculations.
Exercise
A cell displays 2026-11-28, but subtracting it from another date produces an error. What should you check first?
Show answer
Check whether the cell contains text rather than a numeric date value. Apply the Number format or test it with a date formula before converting the text.