+ Reply to Thread
Results 1 to 5 of 5

Change VLOOKUP Table Array in Column Based on Dropdown

  1. #1
    Forum Contributor
    Join Date
    01-16-2020
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    171

    Change VLOOKUP Table Array in Column Based on Dropdown

    In the attached workbook, in the "Expenditures 23-24" worksheet, columns M and N have dropdowns in row 2 that allow the user to select a fiscal year, which corresponds with the data in the worksheets for those two previous years.

    The source for the dropdown list is a named range. It can be found in the Data worksheet in cells P6 through Q9. Column Q lists the name of the table that corresponds to each fiscal year. The catch is that this list will expand, so in the future, when there is a worksheet for fiscal year 2024-2025, the dropdown will show that option because I'll add data to P10 and Q10, and the VLOOKUP reference will have to change to the name of the new fiscal year table, found in Q10.

    I need a way for the user to choose which fiscal year they want to compare in columns M and N. Is there a way to change the table array reference dynamically in all of the rows for that column in the table? Note that the table may get larger or smaller based on the data that is imported. This is only a small subset of data.

    Any help with this is much appreciated!
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    01-16-2020
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    171

    Re: Change VLOOKUP Table Array in Column Based on Dropdown

    I was able to use some code that a forum member helpfully worked up for me with in a similar situation:

    Please Login or Register  to view this content.
    The thing is that I had to make this handle more rows than is necessary. My current full dataset has about 2600 rows, so I have it looking in 3000 rows. However, this seems to affect performance, as it takes a few seconds to work, and ideally, I would like to have a script that only checks in the table column, regardless of how many rows there are.

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Change VLOOKUP Table Array in Column Based on Dropdown

    Please Login or Register  to view this content.
    and change formula

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  4. #4
    Forum Contributor
    Join Date
    01-16-2020
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    171

    Re: Change VLOOKUP Table Array in Column Based on Dropdown

    Thank you so much John! That worked extremely well and the IFERROR is recognizing the 0 value as a monetary value now as well, which I was having trouble with before. I really appreciate your help with this!

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Change VLOOKUP Table Array in Column Based on Dropdown

    You're very welcome and thank you for the rep.

+ 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] Make dropdown source table change based on other cell values
    By Ajaxs87 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-20-2022, 08:53 AM
  2. [SOLVED] how can i make this array change the cell in a column based on a text array
    By dmcgov in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-25-2016, 09:44 AM
  3. VLOOKUP using dropdown list for table array
    By mpquin in forum Excel General
    Replies: 3
    Last Post: 11-05-2014, 09:38 AM
  4. Use dropdown menu to change table array in vlookup
    By davidecollier in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-07-2013, 01:54 PM
  5. [SOLVED] DropDown list of Column A based on Column B of a table
    By aarunb88 in forum Excel General
    Replies: 5
    Last Post: 07-03-2013, 05:11 AM
  6. [SOLVED] auto change of table array in the vlookup
    By iplayball in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-21-2012, 05:41 PM
  7. Replies: 4
    Last Post: 10-27-2011, 01:56 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