+ Reply to Thread
Results 1 to 9 of 9

Basic Time Card

  1. #1
    Registered User
    Join Date
    09-15-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    4

    Basic Time Card

    Hi, I'm having trouble with excel formulas. Monday-Friday regular working hours is 8, Saturday's regular hours is 5. But I need help with adding Saturday to the formulas. Formula should be placed in I6 to I36 and J6 to J36. Formula should use IF statement to determine if day is Saturday. Please see the attachment.
    Attached Files Attached Files
    Last edited by fe007; 09-15-2012 at 03:37 PM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,417

    Re: Basic Time Card

    Presumably on Sunday it's all overtime?

    Pete

  3. #3
    Registered User
    Join Date
    09-15-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Basic Time Card

    Yes but right now I'm just interested in getting the Saturday working hours added to the formulas

  4. #4
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Basic Time Card

    Try

    In I6
    =MIN(((D6-C6)+(F6-E6)+(H6-G6))*24,IF(WEEKDAY(B6)=7,5,8))

    In J6
    =MAX(((D6-C6)+(F6-E6)+(H6-G6))*24,IF(WEEKDAY(B6)=7,5,8))-IF(WEEKDAY(B6)=7,5,8)
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,328

    Re: Basic Time Card

    Hi fe007 and welcome to the forum,

    Try this formula in your I6 and pull it down:
    =IF(((D6-C6)+(F6-E6)+(H6-G6))*24>IF(WEEKDAY(A6)=7,5,8),IF(WEEKDAY(A6)=7,5,8),((D6-C6)+(F6-E6)+(H6-G6))*24)

    It looks like Ace_XL and I are on the same wavelenght in using WeekDay()
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,417

    Re: Basic Time Card

    Well, this should do both. Put this in I6:

    =IF(WEEKDAY(A6,2)=7,0,MIN(IF(WEEKDAY(A6,2)=6,5,8),((D6-C6)+(F6-E6)+(H6-G6))*24))

    and this one in J6:

    =MAX(((D6-C6)+(F6-E6)+(H6-G6))*24-IF(WEEKDAY(A6,2)=7,0,IF(WEEKDAY(A6,2)=6,5,8)),0)

    then copy down.

    I basically changed your first formula from this:

    =IF(((D6-C6)+(F6-E6)+(H6-G6))*24>8,8,((D6-C6)+(F6-E6)+(H6-G6))*24)

    to this:

    =MIN(8,((D6-C6)+(F6-E6)+(H6-G6))*24))

    and then added the extras, so if you can follow what the MIN function is doing the rest should be straightforward.

    Hope this helps.

    Pete

  7. #7
    Registered User
    Join Date
    09-15-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Basic Time Card

    Thanks Ace and Marvin both worked although Ace's formulas helped for my regular hours and overtime.

  8. #8
    Registered User
    Join Date
    09-15-2012
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Basic Time Card

    Petes formulas helped as well

  9. #9
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Basic Time Card

    @ fe007

    Welcome to the forum.

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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