# Calculate number of hours between 2 dates

#### LearnMeExcel

##### Well-known Member
Hi All Excel 2010
AB
1FromTo
215/03/201321/03/2013
318:0012:25
4
5
6I want to calculate number of hours from the date and time in column A To date ad time in column B
7How I could do it and round Number of hours Down
8From 12:25 to 12:00

</tbody>
Sheet1

### Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
LearnMeExcel,

There may well be a more elegant solution but given that you appear to have dates and times in separate cells, does this help....

Excel 2007
ABCDE
1FromToHours
215/03/201321/03/2013155
301:0012:25
Sheet1
Cell Formulas
RangeFormula
E2=((B2-A2)*24)+((N(MAX(HOUR(A3),HOUR(B3))-MIN(HOUR(A3),HOUR(B3))))*(IF(A3>B3,-1,1)))

Hope that helps.

or in E2

=INT(((B2+B3)-(A2+A3))*24)

Replies
5
Views
204
Replies
6
Views
458
Replies
2
Views
48
Replies
8
Views
360
Replies
1
Views
203

1,207,261
Messages
6,077,359
Members
446,279
Latest member
hoangquan2310

### 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.

### Which adblocker are you using?

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

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