+ Reply to Thread
Results 1 to 7 of 7

vlookup error with format cell type

  1. #1
    Registered User
    Join Date
    11-02-2009
    Location
    NM, USA
    MS-Off Ver
    Excel 2003
    Posts
    26

    vlookup error with format cell type

    I am working with excel 2007. I have a vlookup function that is pulling info from a different sheet within the same workbook. the Vlookup function is pulling looking up numeric and alphanumeric data and then populating my cell with its associated name. But there seems to be an issue when the vlookup is pulling the numeric data. So I changed the formatting of the cells to various categories, this works for some and not others. I need the vlookup to work for all regardless of the cell format.
    Please help

    Thanks

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

    Re: vlookup error with format cell type; MS excel2007

    sample data would help and in a workbook!
    "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

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: vlookup error with format cell type

    I am working with excel 2007.
    Would you please change your profile to show that?
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    11-02-2009
    Location
    NM, USA
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: vlookup error with format cell type; MS excel2007

    Data is as such:
    These are in the worksheet "Org Codes" column A and Column B respectively
    3h21200000 ETS
    5517000000 ESH
    17F0000000 PMG
    5512000000 IPG

    Cell C4 is where people enter in a 10-digit code (the ones above) it is formated as Text
    I have a vlookup in cell C5 that states: =VLOOKUP(C4,'Org Codes'!$A$2:$B$3000,2,FALSE)

    So when people enter in an alphanumeric code it works fine, but if they enter a numeric code it doesnot work. I have tried to change the format of cell C4 to general but that does not work, then to numeric and it works for only numeric codes and not alphanumeric.



    Quote Originally Posted by martindwilson View Post
    sample data would help and in a workbook!

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

    Re: vlookup error with format cell type

    either C4 is being entered as text (maybe cell preformatted as text).. or the entries in column A are text.

    Try these... one should work:

    =VLOOKUP(TEXT(C4,"@"),'Org Codes'!$A$2:$B$3000,2,FALSE)

    or

    =VLOOKUP(C4+0,'Org Codes'!$A$2:$B$3000,2,FALSE)
    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.

  6. #6
    Registered User
    Join Date
    11-02-2009
    Location
    NM, USA
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: vlookup error with format cell type

    Thanks, this works for one but then not the other. Is there a way to combine your two plus mine, into one statement that says if this formula doesn't work then try this one, if not this one then this one, etc...

    Thanks!!!!

    Quote Originally Posted by NBVC View Post
    either C4 is being entered as text (maybe cell preformatted as text).. or the entries in column A are text.

    Try these... one should work:

    =VLOOKUP(TEXT(C4,"@"),'Org Codes'!$A$2:$B$3000,2,FALSE)

    or

    =VLOOKUP(C4+0,'Org Codes'!$A$2:$B$3000,2,FALSE)

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

    Re: vlookup error with format cell type

    Perhaps:

    Please Login or Register  to view this content.
    but better to perhaps set the cell and range to the same format from the start.

    To convert to text only...

    Select Column A2:A3000 and go to Data|Text to Columns, skip to 3rd window and select TEXT.

    Repeat for Cell C4

    and then use the original VLOOKUP(C4,... )

+ 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