+ Reply to Thread
Results 1 to 4 of 4

IF statement issue - If not this, then return the result if is less than or equal to

  1. #1
    Registered User
    Join Date
    01-23-2014
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    24

    IF statement issue - If not this, then return the result if is less than or equal to

    I’m working on developing a payroll log of all non-exempt employees. Each person’s payroll record tracks the regular amount of normal 8 hours worked in any given day, tracks any overtime hours, and tracks any double time hours.

    Each record has 4 rows followed by a column for each day and 2 columns to sum all hours for each week in the pay period.

    The first row tracks regular hours.
    The 2nd row tracks any overtime hours.
    The 3rd row tracks any doubletime hours.
    The 4th row logs all hours worked for that day. This is the row where data is entered.

    If 8 hours is worked in a single day, the value of 8 is returned for that day in the 1st row. =IF(E76>8,8,E76)
    If up to 12 hours is worked in a single day, the value of 8 is returned for that day in the 1st row, and the remainder hours is returned in 2nd row for that day. =IF(AND(E76>12, E73=8),4,E76-E73-E75)
    If anything greater than 12 hours is worked in a single day, the value of 8 is returned for that day in the 1st row, the 4 hours of overtime is returned in the 2nd row, and the remaining portion is relegated to the doubletime cell. =IF(AND(E76>12,E73=8),E76-E73-E74,0)

    This works wonderfully…up until I get to the sixth and seventh days of the week. If someone works a normal Monday through Friday schedule, but work overtime on the 6th or 7th days, the formulas in the 1st row, return the number of hours worked in the regular hours, thus it adds to the total number of regular hours and pushes those hours past 40. I need a formula that tells Excel somehow that if 40 hours are worked, do not return the result of 40 in that cell and leave it as 0. So far, I have tried various different if statements and I’m not getting anywhere…I also keep coming across circular references. I’ve tried using AND and OR, which stump me even further but what I really need is a BUT statement but so such formula exist.

    I’ve been trying to tell Excel if the first 5 days are greater than 40, then leave the regular hour cell as 0, but if not, then return the value of the hours worked for that day if it 8 hours or less, but trying to tell the IF function to return the value if false result if it is 8 or less is challenging.

    In Column L, where I sum for the week the hours worked, that if the 1st five days = 40, then leave 40, but if not then add the 6th and 7th days, but I run aground when I try and tell the sixth and seventh days that if 40 hours have been worked, return the result of number of hours work (if it is 8 or less).

    Spreadsheet is attached. I hope I’ve made sense on what I is going on here. Any help would be immeasurably appreciated.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    01-23-2014
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: IF statement issue - If not this, then return the result if is less than or equal to

    Is anyone able to make a recommendation or suggestion? Thanks!

  3. #3
    Forum Contributor
    Join Date
    11-13-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    464

    Re: IF statement issue - If not this, then return the result if is less than or equal to

    I'm assuming the #value results are the areas of concern, right?

  4. #4
    Registered User
    Join Date
    01-23-2014
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: IF statement issue - If not this, then return the result if is less than or equal to

    Essentially, yes; i tried various different failed formulas in there to demonstrate the kind of thinking i was trying to use to get it all to work. If you take for instance the 1st record, the 1st 5 days (E6:I6) equal 40, but that 6th day has 8 hours (J9), so that 8 should not end up in J6, because 40 regular hours have already been met, so instead up going in J6, the value in J9 should calculate into J7 and J8, however, not every one works Monday through Friday, as demonstrated in the next record where a person did not work Wednesday (h14) but work Saturday (J14), so that 3 that shows up in K14 (the 7th days) should calculate into the time and a half cell (K15), leaving K14 to show up as zero so that L14 does not sum more than 40 regular hours. I hope that's clearer-ish.

+ 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. Do Loop Until result equal 0
    By MaxJan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-27-2012, 06:03 PM
  2. If Statement return “W” or “L” result
    By Killer17 in forum Excel General
    Replies: 9
    Last Post: 10-14-2008, 10:23 PM
  3. [SOLVED] excel result return wrong calcuation result
    By garyww in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-14-2006, 06:20 AM
  4. Advanced formula - Return result & Show Cell Reference of result
    By Irv in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-05-2006, 10:40 PM
  5. Equal Sign Issue
    By Jedidia in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 09-06-2005, 12:05 PM

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