+ Reply to Thread
Results 1 to 6 of 6

Finding next Weekday based on Dropdown list

  1. #1
    Registered User
    Join Date
    04-12-2017
    Location
    Vancouver
    MS-Off Ver
    2013
    Posts
    17

    Finding next Weekday based on Dropdown list

    Hey Everyone,

    I'm trying to come up with a formula that will take a date from a certain cell, look at a drop down list (Monday to Sunday) and then return the next available selected Weekday.

    IE: If I typed in June 2nd 2017 (Friday), selected Monday on the drop down, the value should return as June 5th 2017 (Monday).

    This is what I am currently using, it kinda works, but I noticed that it is skipping a week sometimes.

    =IF(AND($J$26="Abroad",$J$27="Wednesday"),$F$25+7-MOD(4+WEEKDAY($F$25,2),7),
    IF(AND($J$26="Abroad",$J$27="Tuesday"),$F$25+6-MOD(4+WEEKDAY($F$25,2),7),
    IF(AND($J$26="Abroad",$J$27="Monday"),$F$25+5-MOD(4+WEEKDAY($F$25,2),7),
    IF(AND($J$26="Abroad",$J$27="Thursday"),$F$25+8-MOD(4+WEEKDAY($F$25,2),7),
    IF(AND($J$26="Abroad",$J$27="Friday"),$F$25+9-MOD(4+WEEKDAY($F$25,2),7),
    IF(AND($J$26="Abroad",$J$27="Saturday"),$F$25+10-MOD(4+WEEKDAY($F$25,2),7),
    IF(AND($J$26="Abroad",$J$27="Sunday"),$F$25+11-MOD(4+WEEKDAY($F$25,2),7),$F$25)))))))

    I noticed that when I put in June 1st (Thursday) and select Friday in the dropdown, it will return June 9th (Friday) instead of June 2nd (Friday) skipping a week.

    Any help would be greatly appreciated!
    Last edited by wvtn; 05-25-2017 at 04:59 PM.

  2. #2
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Finding next Weekday based on Dropdown list

    Hi wvtn- This formula calculates the next date of any specified weekday.
    E1 = Date entered
    F1 = Specified Weekday (1-7) = (MON-SUN)
    =E1+MOD(7-WEEKDAY(E1,2)+F1,7)

    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    Last edited by leelnich; 05-25-2017 at 06:16 PM.

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Finding next Weekday based on Dropdown list

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Date in A1 Weekday in B1
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  4. #4
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Finding next Weekday based on Dropdown list

    Quote Originally Posted by leelnich View Post
    F1 = Specified Weekday (1-7) = (MON-SUN)
    ... and to convert Weekday text (in J27) to a number:

    =MATCH(LEFT($J$27,2),{"Mo","Tu","We","Th","Fr","Sa","Su"},0)

    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    Last edited by leelnich; 05-25-2017 at 08:04 PM.

  5. #5
    Registered User
    Join Date
    04-12-2017
    Location
    Vancouver
    MS-Off Ver
    2013
    Posts
    17

    Re: Finding next Weekday based on Dropdown list

    Thank you everyone, Leelnich, your solution worked perfectly!

  6. #6
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Finding next Weekday based on Dropdown list

    You're most welcome. If you feel this thread is complete, please scroll up to your original post, click on Thread Tools, and mark it SOLVED. Thanks-Lee

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 6
    Last Post: 02-02-2016, 04:26 PM
  2. Replies: 3
    Last Post: 11-13-2015, 05:10 AM
  3. Finding weekday(s) in a formula
    By happy_smiler1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-24-2015, 11:17 AM
  4. Limit dropdown list based on selection from another list
    By msmetal in forum Access Tables & Databases
    Replies: 5
    Last Post: 01-23-2015, 11:22 PM
  5. [SOLVED] Calculate weekday end date based on sum of weekday start date and cell value
    By Rerock in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-01-2014, 09:17 AM
  6. [SOLVED] Conditional Formatting of List based on selections from Dropdown list
    By FoxyPinkChick in forum Excel General
    Replies: 4
    Last Post: 05-31-2013, 03:32 AM
  7. Cull dropdown list options based on selection in another dropdown
    By Kiffar in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-20-2012, 01:53 AM

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