Time Functions
Time in Excel is actually stored as a decimal number ranging from 0 (zero) to 0.99999999, representing the times from 0:00:00 (12:00:00 AM) to 23:59:59 (11:59:59 P.M.). As with dates, you can do standard math, adding and subtracting times, easily with Excel. Functions are available for when you need to do something different. Here are a few you might find useful.
- HOUR
- Returns the hour of a time. The hour is given as an integer, between
0 (12:00 A.M.) and 23 (11:00 P.M.).
Syntax: HOUR(valid time)
- MINUTE
- Returns the minutes of a time. The minute is given as an integer,
between 0 and 59.
Syntax: MINUTE(valid time)
- SECOND
- Returns the seconds of a time. The second is given as an integer
between 0 (zero) and 59.
Syntax: SECOND(valid time)
- TIME
- Returns the decimal number for a specific hour, minute, and second
combination.
Syntax: TIME(hour, minute, second)
Hour - a value between
Minute - a value between
Second - a value between
- TIMEVALUE
- Returns the decimal number of the time represented by a text string.
Syntax: TIMEVALUE(time in text format)
- NOW
- Returns the current date and time.
Syntax: NOW()
The number to the left of the decimal is the date value and the number to the right of the decimal is the time.
Download the sample workbooks functionsamples.xls or for 2007 users functionsamples07.xls.