+ Reply to Thread
Results 1 to 11 of 11

Vlookup returns #NA

  1. #1
    Forum Contributor
    Join Date
    10-26-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2010
    Posts
    138

    Vlookup returns #NA

    I'm confident that the formula is correct =VLOOKUP(B3;Sheet2!B2:C1096;1;FALSE) but it does not return the right answer.. Attached is the document for reference. Thank you
    Attached Files Attached Files

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: Vlookup returns #NA

    VLOOKUP must search for the value in left-column, then returns value in right columns, so in this example must use INDEX/MATCH:
    Please Login or Register  to view this content.
    Quang PT

  3. #3
    Forum Contributor Steve N.'s Avatar
    Join Date
    12-22-2011
    Location
    USA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    298

    Re: Vlookup returns #NA

    See if this helps...

    Your columns on sheet2 needed to trade places. I added the IFERROR to you VLOOKUP so you don't get a bunch of #N/As
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    10-26-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2010
    Posts
    138

    Re: Vlookup returns #NA

    Dear Bebo and Steve, Both formula work... Thank so much..

  5. #5
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,605

    Re: Vlookup returns #NA

    You can use this in 3rd Row and drag down.
    yOUR Sheet1 B column containsNumbers and Sheet2 Column C contains numbers in Text format.Both should be in same format.

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    10-26-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2010
    Posts
    138

    Re: Vlookup returns #NA

    Yes. I copied the formula to the next cell.. I received NA because the cell in sheet 2 is in text.. I tried changing the text format cells to number by right click format cells then number. It didn't work.. What is the best way to do this..

  7. #7
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,605

    Re: Vlookup returns #NA

    Select the C column range.
    Then Select DATA , Text to columns

    In the dialogue box

    Delimited , Next
    Next
    Column Data Format , General , Finish


    You will find all are converted to number format.

  8. #8
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Vlookup returns #NA

    hi jewellove. i think your stock code is meant to be a text, cause it's supposed to have codes with preceding 0s or even alphanumeric. so question should be why Sheet1 column B is in numbers.

    but if your data is indeed like this and you want to convert Sheet2 to numbers, an alternative to kvsrinivasamurthy's method is to select Sheet2!C2:C943:
    scroll back to the top. you should see an exclamation mark in C2. click on it & Convert to number

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  9. #9
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,605

    Re: Vlookup returns #NA

    If the stock code contains preceding 0's ,it is better to convert Sheet1 Column B into TEXT format.
    Select the required range ,Right click ,Format cells
    In Number Tab select Text and OK.

  10. #10
    Forum Contributor
    Join Date
    10-26-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2010
    Posts
    138

    Re: Vlookup returns #NA

    I have two sheets with different format because the data was taken from different sources.. Okay I got it. I checked on
    kvsrinivasamurthy's "Text to Column" and it changes all cells from number to text and vice versa.. Great Tip!!!

    Benishiryo is right that it should be text because some stock codes is proceeded by zeros. I will change all codes to text. Very good advice, guys... Thank you...

  11. #11
    Forum Contributor
    Join Date
    10-26-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2010
    Posts
    138

    Re: Vlookup returns #NA

    I tried Benishiryo's tip to convert cell to text or number... It's a shortcut.. hahahahaha

+ 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