+ Reply to Thread
Results 1 to 11 of 11

Thread: Formatting Cells Problem producing error in my vlookup's

  1. #1
    Forum Contributor
    Join Date
    01-25-2009
    Location
    Louisiana
    MS-Off Ver
    Excel 2007
    Posts
    170

    Formatting Cells Problem producing error in my vlookup's

    I uploaded this file to help show you the problem,

    Currently i have the whole column formatted to text, . All my vlookups work except for a sporadic few ( not sure why ). On the ones that dont work it displays N/A in my adjacent cell's which contain vlookup formula's and i have to format the cell to a number for it to work. I need a way to format the whole column to where it works on every vlookup. I have thousands of row's and its tedious finding every N/A and converting it to a number.

    So again having everything formatted to text produces errors in some vlookup's,

    If i format everything to a number it works but i lose the zero's which cause errors / na's in every part number that lost a zero.
    Attached Files Attached Files
    Last edited by donnydorko; 05-19-2009 at 12:55 PM.

  2. #2
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: Formatting Cells Problem producing error in my vlookup's

    You don't show the formula or the lookup table in your sample so difficult to diagnose...

    ...but the first column of the lookup table should also be text formatted... so that 10381 is a text string in both rows.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Registered User
    Join Date
    05-15-2009
    Location
    Mesa, AZ
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Formatting Cells Problem producing error in my vlookup's

    Not sure why it isn't working for you. Like NBVC said, make sure that the lookup number is formatted as text, so it could be:

    =VLOOKUP("10381",A3:A16,1,0)
    or
    =VLOOKUP(text(A9,"00000"),A3:A16,1,0)

    Most likely you would want to use the latter -- format the cell that you are looking up in addition to the array (which you already did).
    - Leto2
    Excel

  4. #4
    Forum Contributor
    Join Date
    01-25-2009
    Location
    Louisiana
    MS-Off Ver
    Excel 2007
    Posts
    170

    Re: Formatting Cells Problem producing error in my vlookup's

    here is a better example, with the file itself. Because i must be missing something, because i still cant figure it out.

    See the N/A For that 1 part number, doenst make any sense.

    ANy help would be greatful, check out the new upload
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-15-2009
    Location
    Mesa, AZ
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Formatting Cells Problem producing error in my vlookup's

    You need to format all the cells in column A as text. The cell you're looking up and the cell you are looking at need to be the same format (text or value). The cell you're looking up is text and some of the column A cells are General (so they default to value).
    - Leto2
    Excel

  6. #6
    Forum Contributor
    Join Date
    01-25-2009
    Location
    Louisiana
    MS-Off Ver
    Excel 2007
    Posts
    170

    Re: Formatting Cells Problem producing error in my vlookup's

    when i do that in my new example file it still shows the N/A..

  7. #7
    Registered User
    Join Date
    05-15-2009
    Location
    Mesa, AZ
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Formatting Cells Problem producing error in my vlookup's

    Oh ya, you have to go to each cell in the column and press F2 then Enter for the formatting to really change. It's really annoying but for some reason Excel requires it. Basically you have to edit the cell then press enter (even if you don't change anything). You may also be able to copy and paste for the same effect. The formatting change won't take place until the cells are edited.
    Last edited by leto2; 05-19-2009 at 12:42 PM.
    - Leto2
    Excel

  8. #8
    Forum Contributor
    Join Date
    01-25-2009
    Location
    Louisiana
    MS-Off Ver
    Excel 2007
    Posts
    170

    Re: Formatting Cells Problem producing error in my vlookup's

    works , when i copy and paste it doenst work. Wierd, guess i have to go through each cell.. Lame. WOnder why exel does this.

  9. #9
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: Formatting Cells Problem producing error in my vlookup's

    Quote Originally Posted by donnydorko View Post
    when i do that in my new example file it still shows the N/A..
    If you select Column A and go to Data tab, then click Text to Columns.

    Skip to the 3rd window and select Text from the Column Data Format area.. then click Finish...

    That should convert all entries in column A to text.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  10. #10
    Registered User
    Join Date
    02-07-2012
    Location
    Missouri
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Formatting Cells Problem producing error in my vlookup's

    You are still helping people 2.5 years after your post! I tried what you said and it worked perfectly. You saved me a TON of time. Thanks for your help.

    Nick

  11. #11
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: Formatting Cells Problem producing error in my vlookup's

    Nice to hear

    Thanks for reporting that.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

+ 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.2.0