Excel Supreme

Excel track · Exercise 70 of 86 Paid

TODAY and NOW: the volatile clock

Tell today's date from this moment, and read the clock out of a date number.

Intermediate

Invoices dated by day, and one log stamp timed to the minute

Read-only data · screen 1 of 2 · answer in C2

In C2, work out how many days INV-1041 has been open, counting up to the day this exercise pins as today (15 March 2024).

ABC
1InvoiceRaisedDays open
2INV-104145352
3INV-104245358
4INV-104345361
5INV-104445364

Download this grid (.xlsx) Two tabs: the grid you see, and the answer.

C2

What it does

TODAY and NOW read the clock of the machine the workbook is open on, so their answer can change when nothing in the sheet has. TODAY returns the day as a whole serial, 45366 on 15 March 2024. NOW returns that day with the time since midnight in the fraction, so 14:30 is 45366.604166667. Both recalculate on every edit; Excel calls functions that do this volatile.

This sheet asks for days open, which is a subtraction. TODAY minus the raised date in B2 gives 14 for INV-1041. The second screen pulls the hour out of a stamp, because HOUR reads the fraction rather than the day. Building the first column on NOW leaves part of a day on the count.

Reach for TODAY when the answer is a date and NOW when the time of day matters. Volatile formulas recalculate on every edit, so a large sheet full of them is slower than one that reads a typed date from a single cell.

Syntax

=TODAY()   =NOW()   =HOUR(date number)

Worked example

On Invoices dated by day, and one log stamp timed to the minute, =TODAY()-B2 returns 14.

=TODAY()-B2

Common errors

Error codes for TODAY, NOW and HOUR
ErrorWhat it means and how to fix it
#VALUE!HOUR was given a label rather than a date number, or the raised date in B2 was stored as text.
#NAME?TODAY or NOW typed without the empty brackets, so Excel reads the name as an unknown word.
Fraction of a dayNOW keeps the time in the decimal, so a days-open column built on it shows 14.6 for a job that is 14 days old.

At work

An ageing report that counts days open each time the file is opened, and a log line stamped with the moment it was written.