+ Reply to Thread
Results 1 to 19 of 19

Vlookup with 2 cell as file names

  1. #1
    Registered User
    Join Date
    01-15-2013
    Location
    Moncton
    MS-Off Ver
    Excel 2016
    Posts
    95

    Vlookup with 2 cell as file names

    I'm using the below formula were C3 + D3 is the file name were to lockup a value. It works good except if C3 is My and D3 File it only works if the file is saved as MyFile and doesn't work if it's saved as My File with a space. anyway to make this work.

    =VLOOKUP(A3,INDIRECT("'["&C3&D3&"]Sheet1'!A:J"),10,0)

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

    Re: Vlookup with 2 cell as file names

    Try it like this...

    =VLOOKUP(A3,INDIRECT("'["&C3&" "&D3&"]Sheet1'!A:J"),10,0)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    01-15-2013
    Location
    Moncton
    MS-Off Ver
    Excel 2016
    Posts
    95

    Re: Vlookup with 2 cell as file names

    Perfect. Thanks

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

    Re: Vlookup with 2 cell as file names

    You're welcome. Thanks for the feedback!


    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

  5. #5
    Registered User
    Join Date
    01-15-2013
    Location
    Moncton
    MS-Off Ver
    Excel 2016
    Posts
    95

    Re: Vlookup with 2 cell as file names

    Done. Didn't know about that feature

  6. #6
    Registered User
    Join Date
    01-15-2013
    Location
    Moncton
    MS-Off Ver
    Excel 2016
    Posts
    95

    Re: Vlookup with 2 cell as file names

    I spoke to soon. Not sure what I did but now I keep getting #REF. If I click on show calculation step it's showing me the file name it's looking for and it's the exact same name with the space as the file I want to get the information from. Both files are save in the same folder and are both open. What could have happened. It was working at first.

  7. #7
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: Vlookup with 2 cell as file names

    With these 2 files it works
    Attached Files Attached Files
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

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

    Re: Vlookup with 2 cell as file names

    Works OK for me. Both files must be open.

  9. #9
    Registered User
    Join Date
    01-15-2013
    Location
    Moncton
    MS-Off Ver
    Excel 2016
    Posts
    95

    Re: Vlookup with 2 cell as file names

    Well that is strange. I opened both your files at the same time and I get the #REF

  10. #10
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: Vlookup with 2 cell as file names

    Save then in the same dir and open Excel.
    Open the files using excel ('File' 'Open' Browse to the directory and open the files.)
    Don't open the file by clicking the filenames
    Last edited by popipipo; 05-25-2015 at 12:09 PM.

  11. #11
    Registered User
    Join Date
    01-15-2013
    Location
    Moncton
    MS-Off Ver
    Excel 2016
    Posts
    95

    Re: Vlookup with 2 cell as file names

    Saved both files to the same folder. Closed both files and then re opened both files and still get #REF

  12. #12
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: Vlookup with 2 cell as file names

    Did you see I edited my answer?

  13. #13
    Registered User
    Join Date
    01-15-2013
    Location
    Moncton
    MS-Off Ver
    Excel 2016
    Posts
    95

    Re: Vlookup with 2 cell as file names

    Tried (Open the files using excel ('File' 'Open' Browse to the directory and open the files.) and still get #REF

  14. #14
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: Vlookup with 2 cell as file names

    If you go to 'View' 'Switch windows' do you see both file names?

  15. #15
    Registered User
    Join Date
    01-15-2013
    Location
    Moncton
    MS-Off Ver
    Excel 2016
    Posts
    95

    Re: Vlookup with 2 cell as file names

    Yes I see both file names.

  16. #16
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: Vlookup with 2 cell as file names

    My last idea: calculation on manual or automaticaly

  17. #17
    Registered User
    Join Date
    01-15-2013
    Location
    Moncton
    MS-Off Ver
    Excel 2016
    Posts
    95

    Re: Vlookup with 2 cell as file names

    If you mean in the excel option workbook calculation it's set to automatic.

  18. #18
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: Vlookup with 2 cell as file names

    yes that is what I meant

  19. #19
    Registered User
    Join Date
    01-15-2013
    Location
    Moncton
    MS-Off Ver
    Excel 2016
    Posts
    95

    Re: Vlookup with 2 cell as file names

    This is strange. It worked this morning and now it won't work anymore. I thought maybe I change a setting or something without noticing. I just remote connected to my home computer and excel on my home computer should still have factory setting because a rarely use. I save your files and open from the file menu and I still get #REF.

+ 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] vlookup with variable file names
    By L.LEE in forum Excel General
    Replies: 1
    Last Post: 11-28-2014, 07:29 PM
  2. [SOLVED] Vlookup search from other file names
    By hk4kim in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-19-2013, 08:10 PM
  3. [SOLVED] Vlookup search from other file names
    By hk4kim in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-19-2013, 12:35 PM
  4. Using variable file names in vlookup
    By anandvh in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-17-2012, 04:43 PM
  5. Variable file names in a Vlookup
    By kosciosco in forum Excel General
    Replies: 1
    Last Post: 06-22-2010, 05:42 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