Go Back

How to Extract the Time from a Date and Time in Excel

In excel, dates are handled as serial numbers while times as fractional values. There are times when we want to extract time from a date and time. To do this, you will need to use a formula that is based on the MOD function. This article provides an elaborative procedure on how you can use the MOD function to extract time from a date and time in excel.

Figure 1: Extracting time from date and time using MOD function

Syntax of the formula

=MOD (date, 1)

Where;

  • Date- is the date and time from which you want to extract time.

Understanding the formula

  • MOD function is fundamental when it comes to returning a remainder after division.
  • For instance, if the date is in cell B5, then we can have the formula for this as; =MOD(B5,1)
  • In this formula, the first argument is always the number, while the second is the divisor.
  • MOD will bring the fractional part of the number, which in our case is the date.
  • The ability of the MOD function to ignore the integer part and just bring the fractional part makes it the most convenient to extract time from date and time.

The use of the MOD function to extract time from date and time is simply a general format. We can use the formula below to convert the general format to date and time;

=TIME(HOUR(A2),MINUTE(A2),SECOND(A2))

This will bring the result as shown in the figure below;

Figure 2: Example of how to extract time from date and time using time format

Instant Connection to an Expert through our Excelchat Service

Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.

Did this post not answer your question? Get a solution from connecting with the expert.

Another blog reader asked this question today on Excelchat:
Here are some problems that our users have asked and received explanations on

I am using an EXIF file extractor to extract date and time from photos. The time stamp on a certain set of photos is off my several days and several hours.How do I adjust the date and time, by a consistent amount, over a group of cells in excel? The end product would show that all date and times of the incorrectly time stamped photos, would now all be corrected by the same amount, and therefore show the correct date and time in excel.
Solved by X. S. in 29 mins
I need to calculate time in hours before surgery from a date and time of surgery and date and time of injury
Solved by K. C. in 18 mins
I'm trying to extract day of the week from a time stamp to a new column and then the hour of the day from the time stamp into another column
Solved by D. J. in 18 mins

Leave a Comment

avatar