Calculate time

BrendanDixon

Board Regular
Joined
Mar 7, 2010
Messages
174
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi All,

I would like to be able to calculate the no of hours from a specific date and time to another date and time. Only thing is that

Start Date = D15
Start Time = E15
End Date = F15
End Time = G15

I cannot find a function or any info on how to do this, can somone please help me?
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Hi All,

I would like to be able to calculate the no of hours from a specific date and time to another date and time. Only thing is that

Start Date = D15
Start Time = E15
End Date = F15
End Time = G15

I cannot find a function or any info on how to do this, can somone please help me?
Try this...

=(F15+G15)-(D15+E15)

Format as [h]:mm
 
Upvote 0
The difference between T.Valko's answer and mine is the format and units of the answer.


Say you are comparing a start date of December 24th at 12:00 Noon, and End Date of December 25th at 12:00 Noon.

We know the answer of this is exactly 24 hours. My formula generates 24.0 hrs , T.Valko's generates 24:00 (hh:mm)

All a matter of how you want your answer and what are you going to do with it?

If the anwer were 24 hours and 30 minutes, mine would be 24.5 and his would be 24:30.

Just giving you a heads up.
 
Upvote 0
Hi,

I Like a combination of both. I insert the time in minutes but instead of putting ":" I just put "." i.e. I put 9.30 instead of 9:30

This works fine with the formula =((F15-D15)*24)+(G15-E15)

Except when the start time minutes are larger than the end time minutes
i.e. start 7.45 and finish 8.30 I get 0.85 instead of 0.45

Do you know how to fix this?
 
Upvote 0

Forum statistics

Threads
1,224,618
Messages
6,179,919
Members
452,949
Latest member
beartooth91

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top