+ Reply to Thread
Results 1 to 4 of 4

Timesheet and IF conditions

  1. #1
    Registered User
    Join Date
    09-16-2009
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2003
    Posts
    30

    Timesheet and IF conditions

    I have timesheet problem I need help with. I’ve attached a simplified example of my timesheet with five columns: A=Time In, B=Lunch/Other Out, C=Lunch/Other In, D=Time Out, E=Total Hours.
    Factoring in the B and C columns is what has me stumped. Here are the conditions I need to have met:
    If C-B is 30 minutes or less, ignore the value (do NOT factor it into the equation)
    If C-B is greater than 30 minutes, subtract the additional minutes from the total.

    Thanks in advance for your help!

    Kirk
    Attached Files Attached Files

  2. #2
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: Timesheet and IF conditions

    Try =(D2-A2)-MAX(0,(C2-B2-1/48))

  3. #3
    Registered User
    Join Date
    09-16-2009
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Timesheet and IF conditions

    That’s it!!!
    Can you give a brief explanation of how/why this equation works?

    Thanks so much!

  4. #4
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: Timesheet and IF conditions

    Since Excel stores each day as 1, 1/48 is the equivalent of half an hour. Instead of that, you could use TIME(0,30,0) if it's easier. So basically, it's just taking half an hour off of each lunch time and then comparing that to 0, and then taking the larger of the two.

+ 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