+ Reply to Thread
Results 1 to 5 of 5

IF statement with Weekends vs. weekdays

  1. #1
    Forum Contributor
    Join Date
    04-25-2006
    Posts
    215

    IF statement with Weekends vs. weekdays

    I'm looking for an IF statement that basically says the following:

    IF R6 = a weekend (Friday,Saturday,Sunday) then K36 = Data!CY8*(1.23)
    IF R6 = a weekday (Monday - Thursday) then K36 = Data!CY*(1.13)

    I'm not sure how to have it determing the weekends vs weekdays.

    Thanks in advance.

    EP

  2. #2
    Forum Contributor
    Join Date
    03-23-2006
    Location
    Vancouver
    Posts
    114

    =weekday

    Quote Originally Posted by edwardpestian
    I'm looking for an IF statement that basically says the following:

    IF R6 = a weekend (Friday,Saturday,Sunday) then K36 = Data!CY8*(1.23)
    IF R6 = a weekday (Monday - Thursday) then K36 = Data!CY*(1.13)

    I'm not sure how to have it determing the weekends vs weekdays.

    Thanks in advance.

    EP
    Edward:

    The =WEEKDAY function returns 1 for Sunday through 7 for Saturday.

    Therefore formula in K36 should be

    =IF(OR(WEEKDAY(R6)>5,WEEKDAY(R6)=1),Data!CY8*(1.23),Data!CY8*(1.13))

  3. #3
    Toppers
    Guest

    RE: IF statement with Weekends vs. weekdays

    =If(weekday(R6,2)<5,Data!CY8*1.13,Data!CY8*1.23)

    "edwardpestian" wrote:

    >
    > I'm looking for an IF statement that basically says the following:
    >
    > IF R6 = a weekend (Friday,Saturday,Sunday) then K36 = Data!CY8*(1.23)
    > IF R6 = a weekday (Monday - Thursday) then K36 = Data!CY*(1.13)
    >
    > I'm not sure how to have it determing the weekends vs weekdays.
    >
    > Thanks in advance.
    >
    > EP
    >
    >
    > --
    > edwardpestian
    > ------------------------------------------------------------------------
    > edwardpestian's Profile: http://www.excelforum.com/member.php...o&userid=33809
    > View this thread: http://www.excelforum.com/showthread...hreadid=539612
    >
    >


  4. #4
    Forum Contributor
    Join Date
    03-23-2006
    Location
    Vancouver
    Posts
    114
    OK. I learned something.

    The optional parameter ,2 changes the day numbers to 1 for Monday through 7 for Sunday.

    You can also use parameter ,3 which makes Monday 0, and Sunday 6

  5. #5
    Forum Contributor
    Join Date
    04-25-2006
    Posts
    215

    Working great

    Thanks all for the help, it's working perfect.

    Regards,

    EP

+ 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