# Calculating hours from 2 times

#### jfro

##### Board Regular
Hey all,

How can I input 2 hours, in 2 cells and have a cell sum the total hours between them? Below is an example:

Start: End: Hours:
1:00 PM 5:00 PM the sum cell

Thanks!

### Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

#### IML

##### MrExcel MVP
simply subtract them and apply a format of [h]:mm.

If you need this number to perform calculations (ie you mutliply hours by x cost), perform the operation and then multipy by 24 and format as general

Beware that without including the date, the operation will fail if your time range passes midnight. You can buy yourself 1 free pass of midnight by using
=B1+(B1 < A1)-A1
or
=(B1+(B1 < A1)-A1)*24

Thanks!

Replies
0
Views
77
Replies
4
Views
188
Replies
2
Views
151
Replies
2
Views
232
Replies
1
Views
139

1,181,892
Messages
5,932,669
Members
436,850
Latest member
Jasperlee93

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