# Formula count of hours between start/finish times

1. ## Formula count of hours between start/finish times

Hello every body,

I am creating a log of hours worked, so my input is start/finish times in hh:mm format, and I wish for excel to calculate automatically specific hours between start/finish times.

example:
start: 18:00
finish 06:00

night hours: I help in finding a formula to count the total hours 22:00 to 04:00 giving 6,0

Any help appreciated
robenson

2. ## Re: Formula count of hours between start/finish times

Try =MOD(A2-A1, 1)

3. ## Re: Formula count of hours between start/finish times

In terms of night shift - if we assume B2 holds Finish and A2 start then:

``Please Login or Register  to view this content.``
edit: was missing 22:00 to midnight

4. ## Re: Formula count of hours between start/finish times

Assuming that shift could be any length up to 24 hours, e.g. even 03:00 until 22:30, for example, then try this formula in C2 where A2 is shift start and B2 shift end

=MOD(B2-A2;1)*24-(A2>B2)*18-MEDIAN(4;22;B2*24)+MEDIAN(4;22;A2*24)

format C2 as number to get decimal hours

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1