Calculating Billable Hours

lzweifel

Board Regular
Joined
Feb 21, 2006
Messages
213
Can I create a formula to calculate hours overlapping from one day to the next without entering the date. For example...

7:30 pm - 1:30 pm (start work at 7:30 pm and return next day at 1:30 pm) total hours 18 hours.

I know it works if I put in 03-18-10 7:30 pm and 03-19-10 1:30 pm, but I don't really want the date in this column.

Thanks!
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Is this what you are looking for?
Excel Workbook
ABC
18:00AM4:00AM20.00
22:00PM6:00PM4.00
312:00AM6:00PM18.00
43:00AM8:00PM17.00
58:00PM6:00PM22.00
63:00PM7:00PM4.00
76:00AM5:00AM23.00
87:00PM9:00AM14.00
96:00PM10:00AM16.00
108:00PM4:00AM8.00
Sheet1
Cell Formulas
RangeFormula
C1=(B1-A1)*24+(B1)*24


...or you could enter the date, but use cell formatting to only show the time. Then the formula would just be subtraction.
 
Upvote 0
If start time is in A1 and end time is in B1, then the elapsed time is

=IF(B1>A1,B1-A1,B1+1-A1)

This fails if the elapsed time is >= 24 hours. If for example you work from 8:00 AM one day to 9:00 the next day for 25 hours, then this formula would think you only worked one hour, the same day. There is no way around this if you are not including the date.

So don't work too hard :)
 
Upvote 0
On second review, my approach will give you the result in hh:mm:ss format. For billing purposes you probably want fractional hours, in which case taigovinda's approach is more appropriate.
 
Upvote 0
Hi there... thanks for your help.

Taigovinda's formula will work perfect - so I do not have to enter the date just the times?

Also, what if I have time out, time in and then straight hours to add or subtract... for example...

8 pm - 7 am... subtract 2 hours for down time ... Add 3 hours for Shop Time?
 
Upvote 0
Ciao,

=B1-A1+(A1>B1)

could be another solution.

Format cells as [h]:mm.

If you want to subtract 1 hour (D1)

=B1-A1+(A1>B1)-D1/24

or
=B1-A1+(A1>B1)-1/24

And so on.

I hope it helps
 
Upvote 0
Hi there... thanks for your help.

Taigovinda's formula will work perfect - so I do not have to enter the date just the times?

Also, what if I have time out, time in and then straight hours to add or subtract... for example...

8 pm - 7 am... subtract 2 hours for down time ... Add 3 hours for Shop Time?


I think you would probably want to insert another column or two for that. Then type in the number of hours to subtract in those extra columns - and in your formula, modify it so that it does the same thing as now, and then just subtracts the contents of those extra columns (e.g., if the extra columns are C and D, then in E1: =(B1-A1)*24+(B1<A1)*24-C1-D1). Hope that makes sense.
 
Upvote 0
This would allow you to have a break soewhere. You would adjust according to how many breaks you needed

Excel Workbook
IJKLMNO
3startstopHoursstartstopHoursTotal
408:0010:0002:0012:0011:4523:4525.75
Sheet1
Excel Workbook
M
411:45
Sheet1
Excel Workbook
O
425.75
Sheet1
 
Upvote 0
Thank you so very much.... this is exactly what I needed - to be able to stop and start!!!!

Mr. Excel is the BEST!!
 
Upvote 0

Forum statistics

Threads
1,222,890
Messages
6,168,867
Members
452,221
Latest member
PrakashGunabalan

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