+ Reply to Thread
Results 1 to 13 of 13

comparing values and returning different column

Hybrid View

  1. #1
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    VLOOKUP is definitely the function that you need. It's just a matter of applying it.

    What exactly is it doing incorrectly? Are your range set correctly? Did you absolute (use the $ sign) the necessary ranges? (It should look like: =VLOOKUP(B2,SHEET2!$A$1:$A$100,2,FALSE). )

    Other than that, I would again recommend posting a sample of your spreadsheet (use dummy data if your info is confidential).

  2. #2
    Registered User
    Join Date
    10-05-2005
    Posts
    34

    I get #ref! error

    I get the #ref! error when I use the Vlookup function as outlined in the previous post. I have attached an example of the data.
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    I see the error, and I initially advised you incorrectly.

    Your lookup range has to encompass all of the data you are looking in. You have:

    =VLOOKUP(B2,Sheet2!$A$1:$A$2000,2,FALSE)

    It should be

    =VLOOKUP(B2,Sheet2!$A$1:$B$2000,2,FALSE)

    Notice the lookup range has changed from A1:A1000 to A1:B1000

  4. #4
    Forum Contributor
    Join Date
    10-27-2006
    Location
    United Kingdom
    MS-Off Ver
    EXCEL 2003 (2007 at home)
    Posts
    517

    Slight mistake by BigBas

    Try VLOOKUP again but with this small modification

    =VLOOKUP(B2,SHEET2!$A$1:$B$100,2,FALSE).

    The previous example was trying to look in the second column of a single column array!
    Hence the #REF error.

    Mark.

  5. #5
    Forum Contributor
    Join Date
    10-27-2006
    Location
    United Kingdom
    MS-Off Ver
    EXCEL 2003 (2007 at home)
    Posts
    517

    Smile BigBas Beat me to it!:

    My typing is too slow.
    rolleyes:

  6. #6
    Registered User
    Join Date
    10-05-2005
    Posts
    34

    Much thanks...

    I now understand the error and indeed the vlookup function is working perfectly. Thanks for all the information.


    JustMe602

  7. #7
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    Quote Originally Posted by Mark@Work
    My typing is too slow.
    rolleyes:
    Your typing isn't too slow. You just chose to use the red font to display the error, which gave me the slight advantage.

+ 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