ZetCode

Excel HOUR, MINUTE, and SECOND Functions

last modified October 5, 2026

The HOUR, MINUTE, and SECOND functions are the time-of-day counterparts of DAY, MONTH, and YEAR. They read a time value and return one component as a plain number: the hour (0-23), the minute (0-59), or the second (0-59). This tutorial shows how Excel stores times as serial numbers, how the three functions extract components, and how to combine them with TIME and TEXT for formatting, differences, and totals.

HOUR, MINUTE, and SECOND Function Basics

All three functions take one argument, a time, and return a plain integer. They do not return a formatted time, so no time number format is needed to read the result. HOUR returns the hour, MINUTE the minute, and SECOND the second.

Component Description
Function Name HOUR, MINUTE, SECOND
Syntax =HOUR(serial_number), =MINUTE(serial_number), =SECOND(serial_number)
Arguments serial_number - the time to read (one argument, required)
Return Value A plain number: hour 0-23, minute 0-59, or second 0-59

This table summarizes the three functions. Each returns an integer, never a formatted time, and each accepts exactly one argument. Supplying more than one argument produces a "too many arguments" error.

Argument Meaning
serial_number The time to read. It can be a serial number such as 0.75, a time text string such as "14:30:45" or "2:30 PM", a cell reference, or another formula that returns a time, such as TIME(9,30,0) or NOW().

The name serial_number is the key to these functions: Excel stores every date and time as one number, and HOUR, MINUTE, and SECOND simply decode the time portion of that number.

How Excel Stores Times as Serial Numbers

Excel does not store a time as text. It stores a decimal number in which the whole part is a date and the fractional part is the time of day. One full day is 1.0, so noon is 0.5, 6:00 PM is 0.75, and one second is 1/86400. A cell that displays 2:30 PM really contains 0.604166, the fraction of a day that has elapsed since midnight.

Time Serial number HOUR MINUTE SECOND
12:00 AM 0 0 0 0
12:00 PM 0.5 12 0 0
6:00 PM 0.75 18 0 0
6:45 PM 0.78125 18 45 0
1:05:30 AM 0.045486 1 5 30
Jan 1, 1900 12:00 PM 1.5 12 0 0

The table shows how the three functions decode the same serial number. Note the last row: a serial number of 1.5 is 12:00 PM on January 1, 1900. The functions ignore the whole-number date part entirely, so HOUR(1.5) returns 12, not 36. Times always "wrap" at 24 hours, just like a clock.

Extracting from serial numbers
=HOUR(0.5)      ' 12, half a day
=MINUTE(0.5)    ' 0
=HOUR(0.75)     ' 18, three quarters of a day
=HOUR(1.5)      ' 12, the date part is ignored
=MINUTE(0.25)   ' 0, a quarter of a day is 6:00 AM

Basic HOUR Example

This example demonstrates extracting the hour component from a time text string.

Basic HOUR formula
=HOUR("14:30:45")

This formula returns 14, the hour from 2:30:45 PM in 24-hour format. The function ignores the minutes and seconds when returning the hour. A 12-hour text form such as "2:30 PM" gives the same result: =HOUR("2:30 PM") returns 14.

Basic MINUTE Example

This example shows how to extract the minute component from a time value in a cell.

A B
08:45:22 =MINUTE(A1)

The table contains a time value in cell A1 and a MINUTE formula in B1 that extracts the minute component. The formula returns 45.

MINUTE function with cell reference
=MINUTE(A1)

This formula extracts the minute from the time in cell A1 (08:45:22). The result is 45. The function works with direct time strings, with serial numbers, and with cell references that contain time values. =MINUTE("2:30 PM") also returns 30.

Basic SECOND Example

This example demonstrates extracting the second component from a time value.

SECOND function with time value
=SECOND("23:15:07")

The formula returns 7, the seconds from 23:15:07. Like HOUR and MINUTE, SECOND works with serial numbers or with text that Excel can read as a time. Note that SECOND extracts the seconds component; it does not convert the whole time into seconds. For 10 minutes (0:10:00) it returns 0.

Extracting All Three Components

The three functions are often used together to break a time into its parts or to build a custom label. This example extracts every component from one cell.

A B C D
16:25:38 =HOUR(A1) =MINUTE(A1) =SECOND(A1)

The formulas in B1, C1, and D1 return 16, 25, and 38 from the time in A1.

Reconstructing a time with TIME
=TIME(HOUR(A1), MINUTE(A1), SECOND(A1))

This formula rebuilds the original time from its components using the TIME function. For 16:25:38 it returns the same value as A1. The round trip works because TIME is the exact inverse of the three extraction functions.

Converting Time Components to Text

Extracted components are numbers, so they lose any leading zeros when concatenated. Wrap the minute and second in TEXT to keep a two-digit display.

A B
09:05:07 =HOUR(A1)&":"&TEXT(MINUTE(A1),"00")&":"&TEXT(SECOND(A1),"00")
Time label with leading zeros
=HOUR(A1)&":"&TEXT(MINUTE(A1),"00")&":"&TEXT(SECOND(A1),"00")

For 09:05:07 this returns the text "9:05:07". Without TEXT, the result would be "9:5:7". The whole time can also be formatted in one step with =TEXT(A1,"hh:mm:ss"), which returns "09:05:07". Use the component form when you need only some parts or a custom label.

Calculating Time Differences

The three functions can format the gap between two times as hours, minutes, and seconds. This example subtracts a start time from an end time.

A B C
Start End Difference
09:15:30 11:45:15 =HOUR(B2-A2)&"h "&MINUTE(B2-A2)&"m "&SECOND(B2-A2)&"s"

The formula subtracts the start time from the end time (2:29:45) and formats the result as "2h 29m 45s". The result is text, so it is a label rather than a value you can calculate with.

Time difference as text
=HOUR(B2-A2)&"h "&MINUTE(B2-A2)&"m "&SECOND(B2-A2)&"s"

This approach works only when the end time is later than the start time and the gap is less than 24 hours. HOUR resets every 24 hours, and a negative difference returns #NUM!. For longer or negative spans, keep the raw difference and format it with a custom format such as [h]:mm:ss, which does not wrap at 24 hours.

Summing Hours and Minutes

To total a column of durations, convert each row to seconds with the three functions, add the results, and turn the total back into a time.

A
01:30:00
02:45:30
00:45:15
Total duration in seconds
=SUMPRODUCT(HOUR(A1:A3)*3600+MINUTE(A1:A3)*60+SECOND(A1:A3))

The three durations add up to 18045 seconds, which is 5 hours and 45 seconds. Divide the result by 86400 and format the cell as [h]:mm:ss to show it as 5:00:45. SUMPRODUCT handles the ranges without special array entry, so the formula works in every Excel version.

Working with Decimal Time Values

Because times are decimal fractions, the functions also accept raw numbers. This example passes a fraction of a day directly.

Working with decimal time
=HOUR(0.75)

The formula returns 18 because 0.75 of a day equals 18 hours (0.75 x 24 = 18). This shows how the functions read Excel's underlying serial numbers, not just formatted time text.

Excel stores times as binary fractions, and SECOND rounds fractional seconds to the nearest whole second. The literal 0.000011574 of a day is 0.99999 seconds, yet SECOND(0.000011574) returns 1 because the value rounds up. A time such as 12:30:59.6 is likewise treated as 12:31:00, so SECOND returns 0. To keep hundredths of a second, use =MOD(A1*1440,1)*60 instead of SECOND.

Extracting Components from a DateTime

A datetime value has both a date and a time. The three functions read only the time part.

Extracting from datetime
=HOUR("2025-04-04 08:30:15")     ' 8
=MINUTE("2025-04-04 08:30:15")   ' 30
=SECOND("2025-04-04 08:30:15")   ' 15

These formulas extract 8, 30, and 15 from the datetime string, ignoring the date part. The ISO form "2025-04-04 08:30:15" is read the same way in every locale, so it is safer than a text date such as "04/04/2025", whose order depends on the regional settings.

Calculating Total Seconds

Combining the three functions converts any time into a single count of seconds, which is useful for precise timing.

A B
01:05:30 =HOUR(A1)*3600 + MINUTE(A1)*60 + SECOND(A1)

The table converts a time value to total seconds. For 1 hour, 5 minutes, and 30 seconds, the formula returns 3930 seconds (3600 + 300 + 30).

Converting time to seconds
=HOUR(A1)*3600 + MINUTE(A1)*60 + SECOND(A1)

This formula multiplies each component by the number of seconds it represents and adds the results. Because it uses only the clock components, the answer starts again at zero every 24 hours; multiply the whole serial number by 86400 if you need elapsed seconds across multiple days.

HOUR, MINUTE, and SECOND Errors and Troubleshooting

Cause Symptom Fix
Text is not recognized as a time #VALUE! error Use a real time, or ISO text such as "14:30:45"
Negative serial number #NUM! error Times before 0 (12:00 AM) are not supported
More than one argument Too many arguments error Each function accepts a single argument
Duration of 24 hours or more Hour count starts again at 0 Format the raw difference as [h]:mm:ss
End time earlier than the start time #NUM! error Add 1 to the end time, or use a datetime value
Fractional seconds look rounded SECOND returns the nearest whole second Use =MOD(A1*1440,1)*60 to keep the fraction
Ambiguous text date and time Wrong day or month Use an unambiguous ISO date and time
Empty cell passed as the argument HOUR, MINUTE, and SECOND all return 0 An empty cell is treated as serial 0, or 12:00 AM

The HOUR, MINUTE, and SECOND functions are the building blocks of time work in Excel. They decode the fractional part of a serial number and return plain numbers that are easy to sort, compare, and feed back into TIME or TEXT. Once you know that one day equals 1.0, that a serial number of 1.5 still means 12:00 PM, and that SECOND rounds fractional seconds, you can extract components, format labels, measure differences, and total durations without surprises. Master these three functions and the rest of Excel's time toolset becomes far easier to use.

Author

My name is Jan Bodnar, and I am a passionate programmer with extensive programming experience. I have been writing programming articles since 2007. To date, I have authored over 1,400 articles and 8 e-books. I possess more than ten years of experience in teaching programming.

List all Excel Formulas.