+ Reply to Thread
Results 1 to 5 of 5

Dropdown list with formula for months of the current year till date

  1. #1
    Registered User
    Join Date
    02-11-2019
    Location
    Bangaore
    MS-Off Ver
    2016
    Posts
    16

    Post Dropdown list with formula for months of the current year till date

    Hello,

    Is it possible to create a drop-down list with the help of formula which shows only the months till the date in that year.
    For example when i click the drop-down box today (14th February), i should only have January & Februay as options. However if i click the box in July, it should all the months between Jan & July available for selection & if i click in December, all 12 months of the year should be available.

    If it is possible, please let me know how to do it. Thanks in advance for your time.

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Dropdown list with formula for months of the current year till date

    This can be done using a named dynamic range as the source for a list-style data validation.

    Column B has "set up" information. Cell B2 is the current date, cell B3 is the current month and cell B3 is where the current month is found on the list D2:D13.

    I defined a named dynamic range: Month_List =OFFSET(Sheet1!$D$2,0,0,Sheet1!$B$4,1)


    The offset command has 5 parameters
    - A start cell (D2)
    - Number or rows to go down (0)
    - Number of columns to go right (0)
    - Number of rows to return (whatever the value in cell B4 is)
    - Number of columns to return (1)

    Here is more information on the offset command and named ranges: http://www.utteraccess.com/wiki/Offs...Dynamic_Ranges

    Cell B6 has a list validation =Month_List
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    02-11-2019
    Location
    Bangaore
    MS-Off Ver
    2016
    Posts
    16

    Re: Dropdown list with formula for months of the current year till date

    Quote Originally Posted by dflak View Post
    This can be done using a named dynamic range as the source for a list-style data validation.

    Column B has "set up" information. Cell B2 is the current date, cell B3 is the current month and cell B3 is where the current month is found on the list D2:D13.

    I defined a named dynamic range: Month_List =OFFSET(Sheet1!$D$2,0,0,Sheet1!$B$4,1)


    The offset command has 5 parameters
    - A start cell (D2)
    - Number or rows to go down (0)
    - Number of columns to go right (0)
    - Number of rows to return (whatever the value in cell B4 is)
    - Number of columns to return (1)

    Here is more information on the offset command and named ranges: http://www.utteraccess.com/wiki/Offs...Dynamic_Ranges

    Cell B6 has a list validation =Month_List
    Hello,

    Thanks for the solution.
    It works. However, there are many people working on the excel & for that reason, i don't want to maintain a list (someone else may delete it inadvertently).
    Is there no possibility of achieving the result just with formulas/function in a single cell (the drop-down list cell itself).
    Thanks again for your help.

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Dropdown list with formula for months of the current year till date

    You can put the list on a hidden sheet and if that's not enough, protect it. .

    I can't think of another built-in formula that could yield the result, but I am fairly certain it van be done with VBA. However, I like to avoid VB whenever I can.

  5. #5
    Registered User
    Join Date
    02-11-2019
    Location
    Bangaore
    MS-Off Ver
    2016
    Posts
    16

    Re: Dropdown list with formula for months of the current year till date

    Quote Originally Posted by dflak View Post
    You can put the list on a hidden sheet and if that's not enough, protect it. .

    I can't think of another built-in formula that could yield the result, but I am fairly certain it van be done with VBA. However, I like to avoid VB whenever I can.
    Thank you very much. I also do not want to use VBA. I have put the lint in a separate sheet & hidden it. Thanks again for the help.

+ 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. [SOLVED] Excel formula to take an anniversary date to current year
    By jharvey87 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-12-2018, 10:41 AM
  2. Date plus 9, 10 and 12 months, till nearest Saturday
    By Marco-Kun in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-05-2016, 10:02 AM
  3. [SOLVED] VBA Insert Current Month, Year and subsequent months/year for 15 months
    By MichiganWilliams in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-19-2014, 03:49 PM
  4. Replies: 3
    Last Post: 09-04-2013, 10:49 AM
  5. [SOLVED] Keeping a date as current year, even though formula determines previous year
    By dropanddrive03 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-28-2013, 08:31 PM
  6. Replies: 1
    Last Post: 08-13-2012, 11:18 AM
  7. Getting current & completed months of the year
    By jmoses99 in forum Excel General
    Replies: 1
    Last Post: 03-03-2010, 08:24 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