Consulting

Results 1 to 6 of 6

Thread: Weekday formatting

  1. #1
    VBAX Newbie
    Joined
    Mar 2005
    Posts
    1
    Location

    Weekday formatting

    Here is my problem:

    I have an Order Date. I am trying to generate a Ship Date based on this Order Date. If the Order Date is Mon-Thur, the formula would just be Order Date + 1. However, if the Order Date is a Fri, it is Order Date +3; Sat, it is Order Date +2; Sun, it is Order Date +1.

    =IF(WEEKDAY(L2,2)=6,L10+3)
    So basically I want to incorporate three things into the formula:

    If Order Date = 6 (Fri), Order Date +3
    "         "        = 7 (Sat), Order Date +2
    "         "        = 1 (Sun), Order Date +1
    If Order Date = 2 (Mon),3(Tue),4(Wed),or 5(Thu), Order Date + 1
    Any suggestions on how to accomplish this? I can do three different formulas but I was trying to see if I could do it all together.

    Thanks

  2. #2
    Site Admin
    The Princess
    VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    So, wouldn't that be just:

    =IF(WEEKDAY(E9)=6,E9+3,IF(WEEKDAY(E9)=7,E9+2,E9+1))
    ~Anne Troy

  3. #3
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    Possibly, also ...

    =E9+CHOOSE(WEEKDAY(E9),1,1,1,1,1,3,2)

    Note: Untested

  4. #4
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    And what is wrong with ..

    =WORKDAY(E9,1)
    It might need the Analysis ToolPak AddIn, though.
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

  5. #5
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    Quote Originally Posted by TonyJollans
    .. It might need the Analysis ToolPak AddIn, though.
    Yup, it does. I don't have this Add-in on my home pc, so I couldn't test. I knew it was something like that.

    MRomanow: You know this will give you three dates that fall on a Monday (if the dates are consecutive), right? (Making sure I haven't missed anything.)

  6. #6
    VBAX Regular
    Joined
    Feb 2005
    Location
    North West London, UK
    Posts
    19
    Location
    Just tested it:

    =WORKDAY(E9,1)
    Works fine and returns the same date for Friday, Saturday and Sunday i.e. the following Monday

Posting Permissions

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