Sub topic 2
Time of Day as a Fraction of a Day
Prerequisites: entering Excel formulas, using cell references such as A2, and applying number formats.
Time of day as a fraction of a day
Excel stores a date as a serial number and stores its time as a decimal fraction of one day. For example, noon is 0.5, because 12 hours is half a day. A date with a time is therefore the date serial number plus that fraction.
=DATE(2024,3,15)+TIME(12,0,0)Format the result as General to inspect its numeric value. Format it as a date and time to display it meaningfully. Subtracting two date-time values returns elapsed days, including fractional days.
The 1900 and 1904 date systems
Excel workbooks can use the 1900 or 1904 date system. The 1900 system is the usual Windows choice. The 1904 system was used by older Mac workbooks. The systems differ by 1,462 days, so dates can shift if you move values between workbooks using different systems.
The 1900 system also preserves a historical leap-year error: Excel treats 29 February 1900 as if it existed. Avoid using dates near that period.
TODAY and volatile recalculation
TODAY() returns the current date from the computer's clock. It has no arguments.
=TODAY()-A2This counts days since the date in A2. TODAY is volatile, which means Excel recalculates it when the workbook recalculates. A displayed result can therefore change tomorrow without editing the formula.
> callout note > For a fixed reporting date, enter the date as a value or store it in one control cell instead of relying on TODAY().
EDATE: moving by whole months
EDATE(start_date, months) moves a date by a whole number of calendar months.
=EDATE(DATE(2024,1,31),1)This returns 29 February 2024. When the target month lacks the original day, Excel uses the target month's last day.
EOMONTH and first-of-month tricks
EOMONTH(date, months) returns the last day of a month relative to the date.
=EOMONTH(A2,0)To return the first day of the month containing A2, use:
=EOMONTH(A2,-1)+1This pattern is useful for building month ranges. The next month starts one day after the current month's end.
Exercise
What does =EOMONTH(DATE(2024,2,10),-1)+1 return?
Show answer
1 February 2024, the first day of the month containing the input date.