+ Reply to Thread
Results 1 to 10 of 10

Strange Vlookup result - baffled

  1. #1
    Registered User
    Join Date
    01-18-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    2

    Strange Vlookup result - baffled

    Can anyone please point me in the right direction?

    I have a simple vlookup function in a worksheet - I have studied the instructions and looked at tutorials but still cant pull in a price to my column - I have over a 110K prices to pull in so thought I would try a simple table first. can someone please take a look at sample file and educate me where I am going wrong.
    Thanks guys
    Andy
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Strange Vlookup result - baffled

    Your look up is failing because the codes in column A of the prices sheet have line feeds at the end of them.

    You can get round this by changing your look up formula to:

    =VLOOKUP(A2 & "?",Prices!$A$1:$J$179,7,FALSE)

    (Note, the value in A2 genuinely doesn't seem to be on the price sheet, so that line will still return #N/A, but all the other lines work)

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Strange Vlookup result - baffled

    The formula is fine, the problem is the trailing characters in your lookup table

  4. #4
    Registered User
    Join Date
    01-18-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Strange Vlookup result - baffled

    Hi - what is a line feed?
    Sorry new to this
    Thanks
    Andy

  5. #5
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Strange Vlookup result - baffled

    Your Data in Sheets "Prices" Column A has trailing carriage returns (or line feeds?) i.e. Char(10)

    Put this in K2
    Please Login or Register  to view this content.
    Drag/Fill Down
    Then copy the result and Paste Special > Values to A2.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Strange Vlookup result - baffled

    select col a on sheet prices
    then from data tab select text to columns
    select delimited click next
    click other click in the box next to other and do ctrl+j youll see a new dividing line appear in the preview box below
    click next
    in the preview pane you should see two columns headed general separted by a divider
    click on the second "general" to select the column heading
    above it click the "do not import this column (skip)" option
    the preview will show "general" and "skip column"
    click finish
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  7. #7
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Strange Vlookup result - baffled

    Or select the whole table, Ctrl+H, click in the Find box and press Ctrl+J, then with the Replace box blank, press Replace All.
    Good luck.

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Strange Vlookup result - baffled

    i already tried thatbut putting ctrl+j in find doesnt do it , i get a . appear and it can find nothing to replace i also tried alt+010 and alt+0010 neither worked

  9. #9
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Strange Vlookup result - baffled

    Works fine in 2010. You can also use Alt+0010 on the number keypad, or just copy one of the characters and paste it in.

  10. #10
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Strange Vlookup result - baffled

    i must admit ive noticed this before and never got to the bottom of it, sometimes typing in alt+0010 on number pad works just fine other times it doesnt, even tho its the same thing to be removed and i know i have used ctrl+j in the past!

+ 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