+ Reply to Thread
Results 1 to 2 of 2

text / format issues

  1. #1
    Registered User
    Join Date
    06-25-2009
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    9

    text / format issues

    I get a file from HQ (see attached). I'm trying to do a relatively simple vlookup, but it fails because there's a single space in front of a text string.

    eg: the file has " 123abc" ...not "123abc" ...but trying to duplicate it with
    =vlookup(" "&"123abc", range, cols, false) doesn't work!

    Please take a look at the cell formatting, i'm trying to use TEXT() or something to do this vlookup. I can't change the HQ file.

    thanks folks!
    Attached Files Attached Files

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887

    Re: text / format issues

    Hi Leechy,

    The space before your lookup table values is not a regular space character (code 32), it is a non-breaking space (code 160). You have a couple options:

    1. Edit each of those cells and delete the first character manually;

    2. Create a second column for your lookup table and use the following formula to extract all but the non-breaking space character, then lookup on that column with a VLOOKUP formula:
    =RIGHT(A4,LEN(A4)-1)

    3. Don't create a second column, and use the following formula to check your lookup value against an array of the lookup values minus their non-breaking space (note, this is an array formula confirmed with CTRL+SHIFT+ENTER, not just ENTER):
    =INDEX(C4:C6,MATCH(TEXT(A14,"@"),RIGHT(A4:A6,LEN(A4:A6)-1),0))

    4. Use a macro to remove all the non-breaking spaces and then use a normal VLOOKUP.

    I hope that helps you along..

+ 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