+ Reply to Thread
Results 1 to 4 of 4

File referencing in Vlookup

  1. #1
    Registered User
    Join Date
    06-08-2007
    Posts
    28

    File referencing in Vlookup

    Hi Guys,

    This is the simple formula for my vlookup.
    "VLOOKUP(C2,DF6020.xls!$C:$I,7,0)"

    DF6020 is also the contents of cell A2.
    Can I do something like, "VLOOKUP(C2,"A2".xls!$C:$I,7,0)". This obviously doesn't work.

    So eventually I can pick the file name from cell A2 and put the .xls extention after it and do a vlookup into that file?

    I hope I'm clear.

    Thanks

    Rizo

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: File referencing in Vlookup

    You would need to use INDIRECT

    =VLOOKUP(C2,INDIRECT("'["&$A$2&".xls]SheetName'!C:I"),7,0)

    NOTE that XL's in built INDIRECT function will only work if the target file (ie A2) is open... else you will need to use INDIRECT.EXT as offered within the 3rd party morefunc.xll add-in

  3. #3
    Registered User
    Join Date
    06-08-2007
    Posts
    28

    Re: File referencing in Vlookup

    I have already tried this but it doesn't work.
    Gives me #ref error.
    Also the whole point was to get data while the file was closed.

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: File referencing in Vlookup

    Then as stipulated use INDIRECT.EXT (ie install morefunc.xll)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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