+ Reply to Thread
Results 1 to 11 of 11

Might Be Multiple "IF" Issue

  1. #1
    Registered User
    Join Date
    09-13-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2008
    Posts
    11

    Might Be Multiple "IF" Issue

    Hello! I made a time-sheet in Excel that calculates overtime and I'm trying to accomodate the various types of overtime. I have it split out into various columns:
    Regular rate - up to 8 hours for each day
    Daily overtime 1.5 - time and a half for anything over 8 hours for each day
    Daily overtime 2 - double time for anything over 12 hours for each day
    7th consecutive day 1.5 - time and a half for first 8 hours of 7th consecutive day
    7th consecutive day 2 - double time for anything over 8 hours on the 7th consecutive day
    Weekly overtime 1.5 - time and a half for hours greater than 40 for the week (after all other OT has been considered)

    The only ones I can't get to work the way I'd like are the ones for the 7th day of the week... If the employee has worked 7 consecutive days, it needs to calculate time and a half for the first 8 hours, and double time for anything over that.

    I'm thinking it would be an IF formula that will look at the hours input to each of the previous days and if all of them are greater than zero, the hours for the 7th day will appear in that cell... I would put a formula in the cell for regular hours indicating that if the 7th Day OT cell shows greater than zero than the regular cell would be zero.

    I'm not sure how to write the formula that will look at the previous 6 days sequentially and turn the proper result.

    Does that make sense to anyone? Any suggestions much appreciated!!
    Last edited by kthrynileen; 12-17-2012 at 05:27 PM. Reason: SOLVED

  2. #2
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Might Be Multiple "IF" Issue

    If you could upload a sample workbook showing how your data is set up, and a few samples of what you expect to see, it would make answering the post a lot easier...ohterwise about all we can do is offer generalities, or formula's based on a quick WB we create that may not resemble your data at all

    Add a File - click advanced (next to quick post), scroll down until you see "manage attachments", click that and select "add files" (top right corner). click "select files" find your file, select file, click "upload", click 'done" bottom right. click "submit reply"

    Hope this helps
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Might Be Multiple "IF" Issue

    as suggested, upload a sample workbook with all confidential info removed.

    also, take a look at using if(sum(current-cell:6-cells-back)>0,time*1.5,time)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    09-13-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2008
    Posts
    11

    Re: Might Be Multiple "IF" Issue

    Thank you for the quick responses! I spent some more time with this and came up with a solution but I'm not sure if my formulas are unnecessarily complex. I'm attaching the finished product with some sample hours plugged in.

    kp
    Attached Files Attached Files

  5. #5
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Might Be Multiple "IF" Issue

    is the value in c22 correct? creates a negative pay situation..and BTW, thank you for uploading a sample sheet, this definitely is different than what I was thinking about from your initial post

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Might Be Multiple "IF" Issue

    to begin with, try this in F21...
    =IF(COUNTIF(B15:B21,">0")>6,IF(B21<8,B21,8),0)
    next, a few questions...
    1. would it make things easier if you applied the OT factor when calculating the hours worked in each of you're columns? eg D19, instead of 3, 4.5 =IF(B19>12,4*1.5,IF(B19>8,(B19-8)*1.5,0))

    that way, you can just add up the hours to column J and apply the "regular" rate $ 35.00

    2. is there a reason you have that gap between row 21 and 25? the reason i ask is that would it be possible for some1 to work that 7-day stretch from 12/3 to 12/9? that gap makes a calc for that situ more difficult

  7. #7
    Registered User
    Join Date
    09-13-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2008
    Posts
    11

    Re: Might Be Multiple "IF" Issue

    H22 shows the number of regular hours (summed from C15 through C23) that are over 40 and eligible for OT pay after all other OT has been considered... C22 backs out the hours from the regular column so that the do not get added in twice. The same formula is set up in cell C32 for the sum of C25 through C31.

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Might Be Multiple "IF" Issue

    ok try this in F21...
    =IF(COUNTIF(B15:B21,">0")>6,IF(B21<8,B21,8),0)
    and this in G21...
    =IF(COUNTIF(B15:B21,">0")>6,IF(B21>8,(B21-8),0),0)

  9. #9
    Registered User
    Join Date
    09-13-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2008
    Posts
    11

    Re: Might Be Multiple "IF" Issue

    hello! thank you for your help!!

    We need to see the actual number of hours worked (by day and by week) so that is the reason the columns calculate that way. I'm removing the subtotals in column J because the weekly overtime at the end (J22) complicates things and doing the daily subtotal is actually not necessary for our purposes - the data in J36 - J42 is all we need in that respect

    The gap between rows 21 and 25 is to separate the weeks... otherwise we wouldn't be able to calculate the 7th day OT properly. Each week is considered separately so I've left room to calculate the total weekly hours and back out the duplicate weekly overtime hours if necessary.

  10. #10
    Registered User
    Join Date
    09-13-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2008
    Posts
    11

    Re: Might Be Multiple "IF" Issue

    This worked perfectly! And it is much less complicated than what I had originally put in so thank you very much!

    Quote Originally Posted by FDibbins View Post
    ok try this in F21...
    =IF(COUNTIF(B15:B21,">0")>6,IF(B21<8,B21,8),0)
    and this in G21...
    =IF(COUNTIF(B15:B21,">0")>6,IF(B21>8,(B21-8),0),0)

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Might Be Multiple "IF" Issue

    happy to help, and thanks for the rep

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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