How do I compute number of hours using date and hours cell

razon98

New Member
Joined
Sep 17, 2019
Messages
4
Hi All, I have two sets of data start date with hours and end date with hours. How do I compute using these data?

Column 1: Start Date - 27-3-2023
Column 2: Start time - 13:00
Column 3: End Date - 28-3-2023
Column 4: End time - 14:00
Column 5: Duration - 25 hours

Thank you.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Hi,
With all your data in row 2, for cell E2:
Excel Formula:
=C2+D2-(A2+B2)
make sure to format E2 with custom format: [h]:mm
 
Upvote 0
What do you mean by " a date a few days away " ...

Would you mind posting an example ...
 
Upvote 0
What do you mean by " a date a few days away " ...

Would you mind posting an example ...

please refer to screenshot, thank you so much
 

Attachments

  • example.JPG
    example.JPG
    18.4 KB · Views: 10
Upvote 0
Just checked cell E2 formula ... with custom format [h]:mm or 49:00

By the way, even with the wrong format, the result is 2.0416 and not 1.00

So you should make sure dates are dates ...and times are times ...;)
 
Upvote 0
As explained very clearly by Barry Houdini :

1. h:mm is designed for "clock times"...so it never shows more than 23:59....

2. for "elapsed times" (where cumulative hours might be over 24+) you must use [h]:mm
 
Upvote 0

Forum statistics

Threads
1,214,935
Messages
6,122,337
Members
449,077
Latest member
Jocksteriom

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