If you work with data where you have time values then the tips which I’m going to share today can be helpful for you.

Now listen.

In Excel, there’s a lot of functions to deal with date and time.

But there is no specific function which you can use to get the difference between times values.

As you know, a time value is a numeric value which is formatted as time but when you deduct one value from another it returns a decimal number and you need format it again as time.

*But here comes the pain:*

When you format that result value it shows that values as hours and minutes (starting from 00:00) instead of showing actual difference in hours and minutes.

So if you have a difference of 5 hours and 30 minutes it will show it as 05:00 AM.

You don’t have to worry anymore.

## 6 Ways to Calculate Time Difference Between Two Times in Excel

Here are the 6 different methods which you can use to get the difference between time values which you can use as per your need.

…let’s get started.

### 1. Get Difference in Hours and Minutes

This is one the most common way to get the difference between two times.

Let’s suppose you have a start and end time (like below) where you need to get the difference of both.

- First of all, you can simply deduct the end time from the start time and you’ll get something like below.

- Now next you need to convert this time into hours and minutes.

- For this, select the cell and open format options (Ctrl + 1).

- After that, select the “Time” category and select the second time format.

- In the end, click OK.

Once you do this it will convert (Format) that time difference into hours and minutes instead of normal time format.

### 2. Get Different in Hours in Numbers

This is not a common way to get time difference but still useful and important.

Let’s say you want to get the difference between start and end time in hours but not in normal numbers.

For example, if the difference between start and end time is 4 hours and 30 minutes it should show it as 4.5 hours.

Here’s the formula which you need to use.

=(end_time-start_time)*24

Once you enter this formula it returns the hours in numbers and minutes (if you have) in decimals.

#### How this formula works

As I said before, Excel stores date and time in numbers and when you deduct end time from the start time it returns a decimal.

And when further you multiply it by 24 (total number of hours in a day) it converts that decimals into the number of hours and minutes.

### 3. Get Different in Completed Hours

You can also calculate the completed hours between two times with this simple formula.

=INT((end_time-start_time)*24)

#### How this formula works

This formula is just like the formula which we have used in the second method, the only difference is here we have wrapped it in INT.

INT function returns the integer part decimal by rounding it down. You can learn more about it from here.

So when you enter this formula, first of all, it returns a decimal number for the hours and then INT removes the fractional part and gives you completed hours.

### 4. Get Difference in Minutes

It happens sometimes that you need to track time difference in minutes instead of hours, and in this case, the best way is to use the below formula.

=(end_time-start_time)*1440

In this formula, after deducting start time from end time we have multiplied it by 1440 which is the total number of minutes we have in 24 hours.

And when you enter this formula you’ll get the difference between two values in minutes.

**Quick Tip**: If somehow you have seconds in your time values then you use below formula to get the total complete minutes between start and end time.

### #5. Get Difference in Seconds

Same like minutes we can also get the difference in seconds. All you need to do is to use the following formula.

=(end_time-start_time)*86400

Here 86400 is the total second in 24 hours and when you enter this formula it will return the difference in start and end time in seconds.

### 6. Calculate Difference as a Negative Value

In all the above example, we have the end time which is greater than (later than) the start time.

But…But…But…

Let’s suppose you have two time values where the end time is earlier than the start time.

In simple words, if the start time is 11:00 PM on day 1, and the end time is 5:00 AM day 2.

The end time is actually less than the start time and the simple subtract formula will not work and return a negative value which will cause Excel to display a string of hash characters (i.e. ########).

Don’t worry you can use a better formula for this.

So the formula will be:

=IF(end>start, end-start, 1-start+end)

#### How this formula works

In this formula, you have a condition if the end time is greater than the start time then it will simply deduct end time from the start time otherwise, firstly it will deduct start time from 1 and then add it into the end time.

By subtracting the start time from 1, you will get the total time for the day 1 and when you add it to the end time, you’ll get the total time of day 1 and day 2 which is the total difference.

## Sample File

Download this sample file from here to learn more.

## Conclusion

For Excel users who deal with time data, it’s really important to know various methods to get the difference between two times.

And all the methods which we have used above can be used in different situations and I’m sure you have found all of these helpful.

But you need to tell me one thing.

*Do you know any other method which you can use to get the difference between the start time and end time?*

Share your views with me in the comment section, I’d love to hear from you and make sure to share this tip with your friends.

**About the Author**

**Puneet Gogia**

Puneet is using Excel since his college days. He helped thousands of people to understand the power of the spreadsheets and learn Microsoft Excel. You can ﬁnd him online, tweeting about Excel, on a running track, or sometimes hiking up a mountain.

Hello,

How do I create a Nested IF function to calculate pieces picked between two times? Example: I have 42 cases picked between 8:30 am and 9:15 am. I need a formula to capture what was picked in each time period and have each quantity placed under the correct hour (ex: 8:00 am – 9:00 am and 9:00 am – 10:00 am). Is there a function that will allow me to do this? If so, please help.

Start Dates Trips END DATE Trips per day DAYS LEFT

22-06-2019 362 23-07-2019 9 8

22-06-2019 99 23-07-2019 10 8

05-07-2019 76 06-08-2019 12 26

23-06-2019 192 24-07-2019 14 7

I tried multiple formulas but as you see start date is 22 june and end date is 23 july the days left should show 1 day left is shows 8 can you help

Hi Puneet

How do we get a difference between a combination of date & time and date & time without using text to columns for separate date & time.

For this example :04/04/2019 06:00am – 05/04/2019 07:00pm

Thanks for this!

How could I modify the formula to check on the date?

for example, I started at 5 am yesterday, and and ended at 9 am today, the formula would just give 4 hours (if I multiply by 24) instead of 16 hours.

How do you calculate time difference when it’s negative, without getting the ####### treatment?

Reason I’ve needed this is for a work timesheet. If I work later than I should then I’ve worked longer & hence the difference will be positive (time worked in advance of being paid). I then keep a running total of this time.

But another day, when I leave early because I have excess time to “use up”, the difference is negative and ##### results, along with the running total becoming #######.

Potentially, the daily difference AND the running total could be negative so both need to display a negative value without the ### issue happening.

Only way I’ve found is to convert it to decimal number (as in your #2 example, but doing it into mins, then after that dividing that result by 60 to get back to hours as decimal). Problem is then it shows time as -1.25 for example.

How then can one convert the time difference to show as -1:15, as well as still be used as a number to keep the running total going?

How do I calculate time difference between two days i.e. 3/31/19 23:30 start time, and 4/1/19 02:30 end time? The result I want is 3.0 hrs?

DATE DAY IN TIME OUT TIME TOTAL

26-12-2018 Wednesday 11:30 7:45 PM 8:15

27-12-2018 Thursday 10:55 7:30 PM 8:35

28-12-2018 Friday 11:00 7:00 PM 8:00

29-12-2018 Saturday 10:45 6:21 PM 7:36

how can i calculate the total hours of four days, Each day wise i applied formula, kindly send the formula if any one knows

thanks for sharing knowledge.

I need to calculate Time with two different dates, Like TAT calculation