+ Reply to Thread
Results 1 to 6 of 6

Use a variable in a vlookup

  1. #1
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Use a variable in a vlookup

    Goo day, Gurus.

    Using a vlookup formula to return a value from a separate workbook containing multiple sheets. I must reference the sheet in the formula in the 'table_array'. The sheet I must lookup from will change depending on the vendor number for that part. Lets say the in the same row as the 'lookup_value' I also have the vendor number, (010299,010314,011170,etc.), and my other book is split into worksheets based on the vendor number. I am looking up that part number for that vendor and pulling in the manufacturer. Here is the formula that works:
    Please Login or Register  to view this content.
    I want to change "010299" to be whatever value is showing in column V of that same row. I tried this, and a few similar variations, but they didn't work:
    Please Login or Register  to view this content.
    Thanks in advance for any help you can offer.

    Have a good one.
    Last edited by [email protected]; 02-03-2015 at 12:44 PM.

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Use a variable in a vlookup

    You need INDIRECT there..

    =VLOOKUP(F2,INDIRECT("'[PM Vend (02-03-2015).xlsx]"&V2&"'!$B:$T"),19,FALSE)

  3. #3
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Use a variable in a vlookup

    Try:

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

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  4. #4
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Re: Use a variable in a vlookup

    That did it, guys. Thanks.a million. I will mark this thread as "SOLVED".

    Have a great day.

  5. #5
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Re: Use a variable in a vlookup

    That did it, guys. Thanks.a million. I will mark this thread as "SOLVED".

    Have a great day.

  6. #6
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Use a variable in a vlookup

    Thanks for the confirmation.

    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. Replies: 4
    Last Post: 03-06-2014, 07:49 PM
  2. vlookup variable filepath one file variable can this be done via a function?
    By pauldbaker in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-15-2013, 10:10 AM
  3. vlookup with variable range and variable array size
    By chaslie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-16-2013, 02:37 PM
  4. [SOLVED] Can I identify variables using VLOOKUP, and then pass variable to another VLOOKUP?
    By Jeff C in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-05-2012, 05:54 PM
  5. Variable File Reference and Variable Table Array in VBA VLOOKUP
    By Gingeiko in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-28-2011, 11:08 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