+ Reply to Thread
Results 1 to 11 of 11

How to use drop down list to return entire table of data?

  1. #1
    Registered User
    Join Date
    06-25-2015
    Location
    Phoenix, Arizona
    MS-Off Ver
    2010
    Posts
    2

    How to use drop down list to return entire table of data?

    Hello,

    I am trying to use a drop down list to return a table of data. I have monthly returns for three stock market indices (S&P 500, MSCI EAFE, MSCI EM), and I want to be able to select one of those indices from the list in a drop down menu, which will then return the monthly dates and returns columns. Please see my sample data which has the 4 columns: Date, S&P 500, MSCI EAFE, MSCI EM:

    Date S&P 500 MSCI EAFE MSCI EM
    12/30/2005 1.00% 1.00% 1.00%
    1/31/2006 2.00% 2.00% 2.00%
    2/28/2006 3.00% 3.00% 3.00%
    3/31/2006 1.00% 1.00% 1.00%
    4/28/2006 2.00% 2.00% 2.00%
    5/31/2006 3.00% 3.00% 3.00%

    My goal is to select "S&P 500" from my drop down menu, and it will return all data in Columns A (Date column) and B (S&P 500 Returns column), which would be six months of returns with their respective dates.

    I appreciate any help that somebody can provide. I went through forums for a long time but was unable to find my exact issue.

    Thanks.
    Last edited by KTBFFH; 06-25-2015 at 06:30 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: How to use drop down list to return entire table of data?

    Hi, welcome to the forum

    Im not sure how you would ID what you need, when the criteria seems to be a table heading?

    Can you upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: How to use drop down list to return entire table of data?

    Set up the date range by giving it a name for each of the other columns. I assigned names that you will see in the Name Manager.
    Assign Names to each column of data

    Create the drop-down listing. I just listed the names in the Data Validation that matched what I had made for the data columns but not the Date column. The date column is obtained by using =INDIRECT(I2&"D") which is the name that the drop-down list returns and adds a D to it. This will match the names that I assigned to the Date column.

    The enclosed file should be self explanatory (at least better than I can describe with words)

    Deleted file
    Last edited by newdoverman; 06-25-2015 at 08:21 PM.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: How to use drop down list to return entire table of data?

    In my first post I had misunderstood what the column names should be. I think that I have corrected that.

    Sooner or later I will get this right
    Last edited by newdoverman; 06-25-2015 at 08:22 PM.

  5. #5
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: How to use drop down list to return entire table of data?

    Third times a charm...I hope.
    Attached Files Attached Files

  6. #6
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: How to use drop down list to return entire table of data?

    Forgot to add: Make the area for the returns large enough to return the largest amount of data. (Select the area and array enter the formulae given) You will get error values for unused cells. You can hide these errors using Conditional formatting.

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How to use drop down list to return entire table of data?

    Maybe this...

    Data Range
    A
    B
    C
    D
    E
    F
    G
    1
    Date
    S&P 500
    MSCI EAFE
    MSCI EM
    ------
    Date
    S&P 500
    2
    12/30/2005
    1.00%
    1.00%
    1.00%
    12/30/2005
    1.00%
    3
    1/31/2006
    2.00%
    2.00%
    2.00%
    1/31/2006
    2.00%
    4
    2/28/2006
    3.00%
    3.00%
    3.00%
    2/28/2006
    3.00%
    5
    3/31/2006
    1.00%
    1.00%
    1.00%
    3/31/2006
    1.00%
    6
    4/28/2006
    2.00%
    2.00%
    2.00%
    4/28/2006
    2.00%
    7
    5/31/2006
    3.00%
    3.00%
    3.00%
    5/31/2006
    3.00%


    G1 is the drop down list.

    This array formula** entered in F2:

    =IFERROR(INDEX(A:A,SMALL(IF(A$2:A$7<>"",ROW(A$2:A$7)),ROWS(F$2:F2))),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Format as Date

    This formula entered in G2:

    =IF(F2="","",INDEX(B$2:D$7,ROWS(G$2:G2),MATCH(G$1,B$1:D$1,0)))

    Format as Percentage 2 decimal places.

    Select F2:G2 and copy down until you get blanks.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  8. #8
    Registered User
    Join Date
    06-25-2015
    Location
    Phoenix, Arizona
    MS-Off Ver
    2010
    Posts
    2

    Re: How to use drop down list to return entire table of data?

    Thank you very much for the solution, I am extremely grateful!!! I have found that solutions from Tony Valko and newdoverman both work great and I have already started using them. Thanks again!!

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: How to use drop down list to return entire table of data?

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How to use drop down list to return entire table of data?

    You're welcome. Thanks for the feedback!

  11. #11
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: How to use drop down list to return entire table of data?

    You're welcome and thank you for the feedback.

    Good luck.

+ 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. Help. Drop Down Menu to return table of data
    By jbanks in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-19-2014, 01:41 PM
  2. Using a drop down list to display a data set/table
    By EJ101414 in forum Excel General
    Replies: 8
    Last Post: 09-08-2014, 05:21 PM
  3. Replies: 4
    Last Post: 04-11-2013, 12:18 PM
  4. Return column of data by selecting index value from drop down list
    By DWJ in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-08-2010, 12:45 PM
  5. Replies: 1
    Last Post: 04-11-2005, 01:06 PM

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