Results 1 to 5 of 5

Thread: if or (XP)

  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Fontana, California, USA
    Posts
    625
    Thanks
    0
    Thanked 0 Times in 0 Posts

    if or (XP)

    Please see attached - obviously the formula I wrote in Column is not doing what I want it to do - help, please. The object of the formula is to return a 0 if the employee works more than his/her contracted hours on a Sat or Sun - and multiply the hours worked over contract by 1.5 if they worked on any other day.

    Thank you again

    Aunt Linda

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: if or (XP)

    Erm - your attachment didn't make it. Make sure that it's less than 100 KB in size and that you don't preview your post any more after specifying the attachment.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Fontana, California, USA
    Posts
    625
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: if or (XP)

    Clueless . . . sorry
    Attached Files Attached Files

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: if or (XP)

    In the first place, the formula in D5 looks at A2 to see if it is Saturday or Sunday. That makes no sense, A2 contains the text "Name". The formula should look at B5 instead.
    In the second place, you multiply overtime by 1.5 if it is a Saturday or Sunday, and return 0 for other days - exactly the opposite of what you say you want to do.

    Try this formula in D5:

    =IF(OR(B5="Saturday",B5="Sunday"),0,C5*1.5)

    Fill down as far as needed. Alternatively, you can use

    =IF(WEEKDAY(A5,2)>5,0,C5*1.5)

    This uses the WEEKDAY function to test if the date in A5 is a Saturday or Sunday (without needing column [img]/forums/images/smilies/cool.gif[/img].

  5. #5
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Fontana, California, USA
    Posts
    625
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: if or (XP)

    Of course the Weekday function is the perfect answer - thank you.

    And thank you for pointing out that I was having Excel look at the totally incorrect column - can't wait to retire!

    Linda

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •