Calculating hours between 2 dates/times

CaraM

New Member
Joined
Apr 8, 2018
Messages
39
Office Version
  1. 365
Platform
  1. Windows
This is supposed to be an easy "subtract the earlier from the later" formula, but it's not working, for me.

If I want to calculate the HOURS between Sunday 3/9/2025 at 8am and Wednesday 3/12/2025 at 8PM (first date/time in cell A1, 2nd in cell B1), the interwebs tell me my formula should be =B1-A1.

When I use this formula, my result is 12 (when formatted as "h"). That's not right. What am I doing wrong?

If my B1=3/10/2025 8:00 AM, the result is 0!

Book2
AB
13/9/25 8:00 AM
23/12/25 8:00 PM12
Sheet1
Cell Formulas
RangeFormula
B2B2=A2-A1
 
[h] is the total hours whereas h gives hours in a single day.
 
Upvote 0

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