![](https://codky.com/wp-content/uploads/2024/11/13324-1024x576.png)
The `SECOND` function in Excel is used to extract the second component from a time value. This function returns an integer between 0 and 59, representing the second of a given time. Here’s how you can use the `SECOND` function:
Syntax:
SECOND(serial_number)
- `serial_number`: This is the time value from which you want to extract the seconds. This can be a time value, a cell reference containing a time, or a function that returns a time.
How to Use the `SECOND` Function:
=SECOND("2:15:45 PM")
=SECOND(A1)
=SECOND(NOW())
- Using Direct Time:
- If you have a time like “2:15:45 PM” and you want to extract the seconds, you can use:
- This will return `45`.
- Using a Cell Reference:
- If the time is in a cell, say `A1`, you simply reference the cell:
- If `A1` contains the time “3:25:30”, the function will return `30`.
- Using a Formula or Function:
- You can also use the `SECOND` function in conjunction with other date and time functions. For instance:
- This will return the current second at the time when the formula is calculated.
Notes:
- If you enter a date without a specified time, `SECOND` will return `0` since no time data (other than midnight) is provided.
- If the `serial_number` argument does not contain a valid time value, Excel will return a `#VALUE!` error.
The `SECOND` function is particularly useful for time calculations and analysis, such as determining the exact seconds past the minute in time logs or timestamps.