+ Reply to Thread
Results 1 to 7 of 7

Overtime and payment at half hour intervals with a lower payment for the first half hour

  1. #1
    Registered User
    Join Date
    02-21-2014
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    5

    Overtime and payment at half hour intervals with a lower payment for the first half hour

    I am trying to create a spreadsheet which calculates overtime and overtime payment from total hours worked. I have my total hours worked formula in cell L5 for instance which is in hh:mm format.

    A standard day is 9 hours and overtime is given as a payment, say £5.00, for every half hour increment, beginning at 1 min past the half hour. For the first half hour it is a lower rate of payment, say £2.50.

    ie..
    Hours worked: 08:00 - 17:00 = £0 overtime.
    Hours worked: 0800 - 17:01 (up to 17:30) = £2.50 overtime.
    Hours worked: 0800 - 17:31 = £7.50 overtime.
    Hours worked: 0800 - 18:01 = £12.50 overtime.

    So with this I then want: Overtime in cell M5 (which will need to be rounded to each higher half hour if a minute into that half hour) and Overtime payment in N5 in currency.

    I've been trying to do this for myself for a while and I just can't get it right so would really appreciate the help!

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Overtime and payment at half hour intervals with a lower payment for the first half ho

    for instance M5:
    =L5-9/24
    or may be better:
    =MAX(0,L5-9/24)
    and format as hh:mm
    and N5:
    =MAX(0,5*ROUNDUP(M5*48,0)-2.5)
    and format as currency
    5 in formula above is your every (excep first) 30 min overtime payment and 2.5 is 5GBP-first_30_minutes_PAYMENT (5-2.5)
    Last edited by Kaper; 02-23-2014 at 06:32 AM.
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    10-04-2013
    Location
    Bornholm, Danmark
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Overtime and payment at half hour intervals with a lower payment for the first half ho

    is that some thing like this:
    test af timer.xlsx

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Overtime and payment at half hour intervals with a lower payment for the first half ho

    Hi BjarneHansen,
    I do not think it is good formula.
    Try for instance:
    HTML Code: 
    But you introduced a constant (5 GBP) in G2, so let's change your formula to:
    =IF(E4>1,((E4-1)*$G$2)+0.5*$G$2,0.5*$G$2)
    to make use of the constant in G2

    and then correct for above mentioned error:
    =IF(E4>0,(E4-0.5)*$G$2,0)
    (as a side effect we got a shorter formula here, but remember it relies on a "helper cell" E4)
    Last edited by Kaper; 02-24-2014 at 06:26 AM.

  5. #5
    Registered User
    Join Date
    02-21-2014
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Overtime and payment at half hour intervals with a lower payment for the first half ho

    Hi Kaper,

    This works brilliantly thanks. The only issue is that N5 contains the first payment of overtime (2.5) even when there has been under 9 hrs 1 min worked.

    Brett

    (This is in relation to your first post)

  6. #6
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Overtime and payment at half hour intervals with a lower payment for the first half ho

    Hi Brett,

    This is the problem of representing fractions in excel - they are a double precision floating point numbers.
    So if you have for instance 8:00 - 17:00 then the difference is 9:00
    And if you deduct 9/24 from it (as in M5) it is displayed as 0:00. So far it looks good.
    But if you try a formula
    =M5>0
    you will get TRUE as a result !!!
    moreover - if you change formatting of the cell from time to general, you will see that the value is
    5,55112E-17
    Pretty small, but then it is multiplied (still very small, but non-zero) and then rounded up - here problem occurs.

    If your input data has 1 minute accuracy it will be enough to make a minor correction (half a minute) for N5:
    =MAX(0,5*ROUNDUP(M5*48-1/60,0)-2.5)

    see attachment.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    02-21-2014
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Overtime and payment at half hour intervals with a lower payment for the first half ho

    That's the ticket! Thanks for this and thank you for explaining why it works like it does, that should help me understand it in the future.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Calculate Fractional minutes between half hour intervals with multiple start and end times
    By CheeksExcelForum in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-20-2013, 02:19 PM
  2. Replies: 1
    Last Post: 05-03-2013, 04:39 AM
  3. [SOLVED] relative references? Converting half hour incriments into hour incriments
    By Babbabooie in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-07-2012, 11:27 AM
  4. Replies: 1
    Last Post: 08-10-2010, 02:13 AM
  5. Inserting rows:half-hour intervals
    By Aloysicus in forum Excel General
    Replies: 0
    Last Post: 07-26-2005, 03:05 AM

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