Intro
Extract time from date and time in Excel using formulas and functions, including HOUR, MINUTE, and SECOND, to manipulate datetime values and perform time-related calculations with ease and accuracy.
Extracting time from a date and time value in Excel can be a common requirement for various data analysis and reporting tasks. Excel provides several ways to achieve this, including using formulas and functions. Understanding how to extract time can help you manipulate and analyze your data more effectively.
To begin with, it's essential to understand how Excel stores date and time values. Excel stores dates as serial numbers, starting from January 1, 1900, which is considered as day 1. Time is stored as a fraction of a day. For example, 12:00 PM (noon) is stored as 0.5 because it is halfway through the day. This storage method allows for easy date and time calculations.
Using the TIME Function
The TIME function in Excel is used to return a time value from hour, minute, and second values. However, if you want to extract the time part from a date/time value, you can use the TIME function in combination with other functions like HOUR, MINUTE, and SECOND.
For example, if you have a date/time value in cell A1 (e.g., 2023-04-01 14:30:00), you can extract the time part as follows:
- Hour:
=HOUR(A1)
returns 14 - Minute:
=MINUTE(A1)
returns 30 - Second:
=SECOND(A1)
returns 0
You can then combine these values into a time format using the TIME function:
=TIME(HOUR(A1), MINUTE(A1), SECOND(A1))
This formula essentially extracts the time part from the date/time value in cell A1.
Using the TEXT Function
Another approach to extract and display the time part from a date/time value is by using the TEXT function. This function formats a value according to a specified format. For time, you can use:
=TEXT(A1, "hh:mm:ss")
This formula formats the value in cell A1 to display the time in hours, minutes, and seconds. The "hh:mm:ss" format specifier stands for:
hh
: Hour in 24-hour format (01 to 23)mm
: Minute (00 to 59)ss
: Second (00 to 59)
You can adjust the format specifier based on your needs, such as using "hh:mm" for hours and minutes only.
Using the MOD Function
If you want to extract the time part as a decimal value representing the fraction of the day, you can use the MOD function:
=MOD(A1, 1)
This formula returns the fractional part of the date/time value in cell A1, which represents the time as a fraction of the day. To convert this fraction into hours, minutes, and seconds, you can multiply by 24 (since there are 24 hours in a day), and then apply the necessary conversions.
Practical Examples
Let's say you have a list of date/time values in column A, and you want to extract the time part into column B. You can use any of the methods described above, depending on how you want to represent the time.
-
Using TIME Function:
- In cell B1, enter
=TIME(HOUR(A1), MINUTE(A1), SECOND(A1))
, and then copy the formula down to other cells in column B.
- In cell B1, enter
-
Using TEXT Function:
- In cell B1, enter
=TEXT(A1, "hh:mm:ss")
, and then copy the formula down.
- In cell B1, enter
-
Using MOD Function (for fractional time):
- In cell B1, enter
=MOD(A1, 1)
, and then copy the formula down.
- In cell B1, enter
Gallery of Excel Time Extraction










Gallery of Excel Time Extraction Techniques
Excel Time Extraction Techniques










FAQs
How do I extract the time from a date/time value in Excel?
+You can extract the time from a date/time value in Excel by using the TIME function, TEXT function, or MOD function, depending on how you want to represent the time.
What is the difference between the TIME and TEXT functions for extracting time?
+The TIME function returns a time value that can be used in calculations, while the TEXT function formats the time as text, which is useful for display purposes but not for calculations.
How do I format the extracted time in a 12-hour format with AM/PM?
+You can use the TEXT function with a format specifier like "hh:mm:ss AM/PM" to format the extracted time in a 12-hour format with AM/PM.
Can I use the extracted time for further calculations in Excel?
+Yes, if you extract the time using the TIME function, you can use it for further calculations. However, if you use the TEXT function, the result is text and cannot be used directly in calculations.
How do I handle dates and times in different time zones in Excel?
+Excel provides functions like TIMEZONE and WORKDAY.INTL to handle dates and times in different time zones. You can also use add-ins or third-party tools for more complex time zone management.
In conclusion, extracting time from date and time values in Excel is a straightforward process that can be accomplished using various functions and methods. By understanding how Excel stores date and time values and applying the appropriate functions, you can easily extract and manipulate time data for your analysis and reporting needs. Whether you're working with simple time extractions or complex time zone conversions, Excel offers the tools and flexibility to meet your requirements. Feel free to share your experiences or ask further questions about working with dates and times in Excel.