Hours between two dates

JTL9161

Well-known Member
Joined
Aug 29, 2012
Messages
593
Office Version
  1. 365
Platform
  1. Windows
I have these dates and time

(P16) 8/22/24 5:23 AM
(S16) 08/23/24 5:18pm

I am trying to just calculate total hours between the 2 dates.

I tried =TEXT(S16-P16,"h") but I get a #VALUE! error.


Any help would be appreciated.
James

 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Try putting a space between the 8 and the pm in 08/23/24 5:18pm

Your formula also needs some [] or use the formula by @myall_blues formatted to suit
Excel Formula:
=--TEXT(S16-P16,"[h]")
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,811
Messages
6,181,081
Members
453,021
Latest member
Justyna P

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