+ Reply to Thread
Results 1 to 10 of 10

Vlookup not working on some but works on few.

  1. #1
    Registered User
    Join Date
    08-05-2010
    Location
    United States
    MS-Off Ver
    Office Pro Plus 2010
    Posts
    15

    Vlookup not working on some but works on few.

    Hey EHF!

    OK so I am doing a vlookup from sheet2 to match Iowa (2) sheet tax codes. I used Vlookup, as you will see in column F sheet2 to grab data from sheet called iowa 2, why are some erroring out and others working? Anyone know a work around?

    The forum didnt let me attach it so her eis a external link to view the xl file.

    Downlaod

    http://microunified.com/demo/Zcodes.xls

    Thank you for taking the time to help!

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: Vlookup not working on some but works on few.

    In your example. Your look up value is Belle Plaine with a space between the two words. In you lookup table it is spelled without the space. Excel views these as two separate items.

    In the case of Bloomfield, in your lookup table there is an extra space after the name. Again, excel views these as two separate items. Your look up data must be exactly the same to return what you need.

    I only looked at the two items. If there are more items, then I suspect that there are similar issues of spacing.
    Last edited by alansidman; 10-16-2013 at 12:20 PM.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,411

    Re: Vlookup not working on some but works on few.

    Nothing seemed to happen when I clicked your link (got the message "Downloading from microunified.com", but after a couple of minutes I gave up).

    Can you post your formula here? I suspect that you have not used absolute addresses in your table, so that when you copy it down the addresses change.

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    08-05-2010
    Location
    United States
    MS-Off Ver
    Office Pro Plus 2010
    Posts
    15

    Re: Vlookup not working on some but works on few.

    Try right click and save as and download that way. Is there a way to tell vlookup to ignore the spaces? My formula is =VLOOKUP(C284,'Iowa (2)'!$A$5:$E$1367,4,FALSE)

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: Vlookup not working on some but works on few.

    You will have to run a clean or trim on the ones with extra spaces like Boone. For issues like Belle Plaine, you will have to manually clean them up. This is can be an irritant when the data comes from two different sources and was entered differently.

    For the clean/trim, you may want to create a simple macro that runs down the entire column for each sheet and does a clean/trim.

    Alan

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Vlookup not working on some but works on few.

    BellePlaine is all one word on Iowa(2).

    Bloomfield has a space at the end on Iowa(2), as do Boone, Burlington, Carroll, Cedar Rapids...

    So basically the data in column C on Sheet2 isn't matching the data in column A on Iowa(2) because of things like that.
    If posting code please use code tags, see here.

  7. #7
    Registered User
    Join Date
    08-05-2010
    Location
    United States
    MS-Off Ver
    Office Pro Plus 2010
    Posts
    15

    Re: Vlookup not working on some but works on few.

    Yeah def it was the spaces for sure, thanks for telling me, had no idea.

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,411

    Re: Vlookup not working on some but works on few.

    You could do this to ignore the spaces in C284:

    =VLOOKUP(SUBSTITUTE(C284," ",""),'Iowa (2)'!$A$5:$E$1367,4,FALSE)

    but that assumes that you do not have spaces in column A of the Iowa (2) sheet - you can remove those using Find & Replace (CTRL-H) in one operation.

    Hope this helps.

    Pete

  9. #9
    Registered User
    Join Date
    08-05-2010
    Location
    United States
    MS-Off Ver
    Office Pro Plus 2010
    Posts
    15

    Re: Vlookup not working on some but works on few.

    OK cool, well hey thanks everyone for the quick and prompt responses. I learned something new. hanks again for all of your guys time and effort. I really appreciate it!

  10. #10
    Registered User
    Join Date
    08-05-2010
    Location
    United States
    MS-Off Ver
    Office Pro Plus 2010
    Posts
    15

    Re: Vlookup not working on some but works on few.

    Quote Originally Posted by Pete_UK View Post
    You could do this to ignore the spaces in C284:
    =VLOOKUP(SUBSTITUTE(C284," ",""),'Iowa (2)'!$A$5:$E$1367,4,FALSE)
    Pete
    I will give this a shot, thank you!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Goal Seek not working on 1 PC but works fine on another?
    By jennymc in forum Excel General
    Replies: 7
    Last Post: 07-11-2013, 10:49 AM
  2. SSN Format Code Works... Then stops working?
    By sgtclaire in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-13-2013, 09:43 AM
  3. Advanced Filter not working with VBA, but works manually.
    By sundar2182 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 12-31-2012, 06:00 AM
  4. alt+tab not working in Excel (works otherwise)
    By craigster in forum Excel General
    Replies: 1
    Last Post: 05-15-2008, 02:47 PM
  5. [SOLVED] Function not working (but works as a sub). Any ideas?
    By reppy@usa.net in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-07-2006, 03:15 PM

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