Simple hour vs day formula

sassriverrat

Well-known Member
Joined
Oct 4, 2018
Messages
655
Good Evening,

I have a formula here that calculates the time difference from one date to another. It should spit this back in whole hours and it does. However, if I go over 23 hours (i.e. noon to noon), it goes back to zero because I think it's taking out a day. I need it to be able to hit 24+ hours. How might I fix this?

Note:
D4 is a time (both the active and the previous sheet)
F4 is a date (both the active and the previous sheet)

Code:
 
Thats not true mole. As far as i can tell he wants the number of hours as an integer ie 1 = 1 hour. If it was formatted as time then 1 = 1 day.
 
Upvote 0

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
@mole999 and @steve the fish

Is there a notable positive of having my original formula versus not having the "hour" piece? I can't remember why I threw the "hour" piece in there- but when I wrote the workbook last year there was a ton of experimenting....so I would have had a reason I suppose
 
Upvote 0
HOUR can never go over 23. So HOUR(0.01) produces the same number as HOUR(1.01). If you want to go over 23 hours then use what i suggested in multiplying the formula by 24. 24*1.01 can clearly go over 24.
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,259
Members
452,626
Latest member
huntinghunter

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