+ Reply to Thread
Results 1 to 8 of 8

lookup_value in VLOOKUP formula

Hybrid View

  1. #1
    Registered User
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    11

    lookup_value in VLOOKUP formula

    In Workbook 1 I'm using the formula;

    =IF(ISNA(VLOOKUP(C2,INDIRECT("'C:\Documents and Settings\user\Desktop\["&A1&".xls]Sheet1'!$a1:b$300"),2,0)),"Not Applicable",(VLOOKUP(C2,INDIRECT("'C:\Documents and Settings\user\Desktop\["&A1&".xls]Sheet1'!$A1:B$300"),2,0)))

    to grab data from Workbook 2.

    My question is, rather than having to specify the lookup_value in cell C2, can I specify the value directly in the formula itself.

    Example: if I want to return the value from Workbook 2 when "Example" is entered in cell C2. Instead of having to enter "Example" in C2 could the formula somehow have the word "Example" in it for the lookup_value.

    Thanks for the help.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: lookup_value in VLOOKUP formula

    Just replace C2 in the formula with the word Example, enclosed in double quotes....( "Example" )
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: lookup_value in VLOOKUP formula

    That's what I thought I should do as well but when I tried it all I get is the "Not Applicable" even though a value does exist.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: lookup_value in VLOOKUP formula

    There are 2 occurances of C2 in your formula: Should look like this:


    =IF(ISNA(VLOOKUP("Example",INDIRECT("'C:\Documents and Settings\user\Desktop\["&A1&".xls]Sheet1'!$a1:b$300"),2,0)),"Not Applicable",(VLOOKUP("Example",INDIRECT("'C:\Documents and Settings\user\Desktop\["&A1&".xls]Sheet1'!$A1:B$300"),2,0)))

  5. #5
    Registered User
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: lookup_value in VLOOKUP formula

    Sorry NBVC,

    I should've mentioned I changed both values with no luck.

    Thanks for the help!

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: lookup_value in VLOOKUP formula

    Well, if it worked with C2 having the exact word Example (without quotes), then it should, theoretically work replacing C2 with "Example" (with quotes).

    I would need to see sample workbooks to see why it doesn't work then...

    Are you positive that the sheet referenced in A1, and in column A1:B300, the word "Example" exists exactly as you typed it in the formula.. and without extra spaces, etc...

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: lookup_value in VLOOKUP formula

    As I mentioned above:

    Quote Originally Posted by NBVC View Post
    ..
    Are you positive that the sheet referenced in A1, and in column A1:B300, the word "Example" exists exactly as you typed it in the formula.. and without extra spaces, etc...

  8. #8
    Registered User
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: lookup_value in VLOOKUP formula

    Figured it out.

    The values that I am searching for are genreated by another program that creates a spreadsheet. The program was inserting a space after the value, which I didn't put in.

    Thanks again NBVC

+ 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