Calculate hours between 2 dates and times

justDave

Board Regular
Joined
Mar 2, 2006
Messages
83
Hi all,

Hopefully a very simple question for you all:

I have a series of dates and times in DD/MM/YYYY HH:MM format - is there a simple way of calculating the number of hours between them? I tried just subtracting one from the other but it gave me a #VALUE! error.

Many thanks in advance
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
If you just wanted to try deleting them then this might work.

=INT((A1-B1)*24)
 
Upvote 0
Hi,

Are you sure they are both DD/MM/YYYY HH:MM format? I have just tested it using:

19/04/2011 09:49 and 18/04/2011 05:44 then I did =B1-A1 and formatted as [hh]:mm and it gave me 28:05 which is correct.
 
Upvote 0
You're right, there is a formatting issue somewhere in the times. I will dig into these and find out where the issue is.

Many thanks for both of your time.
 
Upvote 0
What dates do you have in your sheet?

If you edit the dates so that both have a day not greater than 12, do you get a result then?
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,283
Members
452,902
Latest member
Knuddeluff

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