# Extract time from datetime in Excel

Extracting time from a datetime in Excel is essential for isolating the time component and performing specific time-based operations. It enables sorting, filtering, and analyzing data based on time intervals or ranges. Extracted time values can be used in calculations, comparisons, or formatting. It provides flexibility to work with time-related information independently of the date component. Overall, extracting time from datetime in Excel enhances efficiency and accuracy in time-related tasks.

## How to extract time or hour only from datetime in Excel

To extract the time or hour only from a datetime value in Excel, you can use the following methods:

Method 1: Using the TEXT function

1. Assuming your datetime value is in cell A1, enter the formula “=TEXT(A1,”hh:mm:ss”)” to extract the time in the format of hours, minutes, and seconds.
2. Copy the formula down to apply it to multiple cells if needed.

Method 2: Using the HOUR function

1. Assuming your datetime value is in cell A1, enter the formula “=HOUR(A1)” to extract the hour component only.
2. Copy the formula down to apply it to multiple cells if needed.

Remember to format the result cells as “Time” or “Custom” to display the extracted time or hour correctly.

## Extract time only from date time cells with MOD function

To extract the time only from datetime cells using the MOD function in Excel, follow these steps:

1. Assuming your datetime value is in cell A1, enter the formula “=MOD(A1, 1)”.
2. The MOD function returns the remainder when dividing the datetime value by 1.
3. Since dates are represented as whole numbers and time values as decimal fractions, extracting the remainder gives us the time component.
4. Format the result cells as “Time” or “Custom” with the desired time format to display the extracted time correctly.
5. Copy the formula down to apply it to multiple cells if needed.

## Extract Date from Text String

you can use a combination of text functions like LEFT, MID, RIGHT, and DATEVALUE. Follow these steps:

1. Assuming the text string is in cell A1, you can use the formula “=DATEVALUE(MID(A1, FIND(“/”, A1) – 2, 10))”.
2. The FIND function locates the position of the “/” character in the text string.
3. The MID function extracts the substring starting two characters before the “/” and with a length of 10 characters (assuming the date format is consistent).
4. The DATEVALUE function converts the extracted substring into a date value.
5. Format the result cell as “Date” or “Custom” with the desired date format to display the extracted date properly.

## Extract Date from Datetime

you can use the following approaches:

Approach 1: Using the INT function

1. Assuming your datetime value is in cell A1, enter the formula “=INT(A1)”.
2. The INT function rounds down the datetime value to the nearest whole number, which represents the date component.

Approach 2: Using the DATE function with YEAR, MONTH, and DAY functions

1. Assuming your datetime value is in cell A1, enter the formula “=DATE(YEAR(A1), MONTH(A1), DAY(A1))”.
2. The YEAR function extracts the year component from the datetime value.
3. The MONTH function extracts the month component from the datetime value.
4. The DAY function extracts the day component from the datetime value.
5. The DATE function combines these extracted components to create a new date value.

Ensure that the result cells are formatted as “Date” or “Custom” with the desired date format to display the extracted date correctly.