+ Reply to Thread
Results 1 to 2 of 2

calculate hours

  1. #1
    Registered User
    Join Date
    09-26-2005
    Posts
    13

    calculate hours

    Hi
    I have a spreadsheet formated custom hh:mm in cells A2:A6, A2 is the start time (1am), A3 is a break (45mins) taken at 3.45am, A4 is a break (1hour) taken at 5.15am, A5 is my finish time 1445pm, I get extra £3.00 an hour for hours worked between 18:00 and 06:00. A6 is total hors worked. I want another cell (A7) to show how many hours were worked between 18:00 and 06:00. Calculation can show with breaks out or included, or both.
    Many Thanks
    Caveman

  2. #2
    Fred Smith
    Guest

    Re: calculate hours

    Try something like this:

    a7 =min(a5,time(6,0,0))-if(a2<a5,a2,max(a2,time(18,0,0))-1)

    This will calculate the total time worked between 18h00 and 6h00, including
    breaks.

    To subtract the breaks, you would deduct:

    =if(and(a3>time(5,15,0),a3<time(6,0,0)),time(6,0,0)-a3,0)+if(and(a4>time(5,0,0),a4<time(6,0,0)),time(6,0,0)-a4,0)

    Hope this helps.

    --
    Regards,
    Fred


    "Caveman" <[email protected]> wrote in message
    news:[email protected]...
    >
    > Hi
    > I have a spreadsheet formated custom hh:mm in cells A2:A6, A2 is the
    > start time (1am), A3 is a break (45mins) taken at 3.45am, A4 is a break
    > (1hour) taken at 5.15am, A5 is my finish time 1445pm, I get extra £3.00
    > an hour for hours worked between 18:00 and 06:00. A6 is total hors
    > worked. I want another cell (A7) to show how many hours were worked
    > between 18:00 and 06:00. Calculation can show with breaks out or
    > included, or both.
    > Many Thanks
    > Caveman
    >
    >
    > --
    > Caveman
    > ------------------------------------------------------------------------
    > Caveman's Profile:
    > http://www.excelforum.com/member.php...o&userid=27546
    > View this thread: http://www.excelforum.com/showthread...hreadid=546484
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Bookmarks

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