+ Reply to Thread
Results 1 to 12 of 12

Lookup formula not working on certain cells

  1. #1
    Forum Contributor
    Join Date
    11-11-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    129

    Lookup formula not working on certain cells

    I have extracted some data from a database and have a situation where I want to display the vehicle franchises. Sometimes I have to display multiple franchises, so I have added that combination to the lookup table, however on some occasions it is not working...

    Can anyone give me a reason why I can't get this to work? I have attached an example below. The main error seems to be in cell C4!

    Thanks for the help
    Attached Files Attached Files

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Lookup formula not working on certain cells

    What result do you expect in C4?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

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

    Re: Lookup formula not working on certain cells

    i think you need to sort your lookup list by length smallest to largest else lookup will return the last match which the way you have it laid out is KIA
    see attached
    Attached Files Attached Files
    "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

  4. #4
    Forum Contributor
    Join Date
    11-11-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Lookup formula not working on certain cells

    The answer that's in C25

  5. #5
    Forum Contributor
    Join Date
    11-11-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Lookup formula not working on certain cells

    Brilliant. Never realised that the lookup table had to be sorted

  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: Lookup formula not working on certain cells

    look up like that returns the last value where there is a match kia matches and is last in the list

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Lookup formula not working on certain cells

    You have some kind of "junk" in cell B4.

    I added the CLEAN function to the formula in C4 and it returned the correct result.

    =IFERROR(LOOKUP(2^15,SEARCH(" "&$C$12:$C$27&" "," "&CLEAN(B4)&" "),$C$12:$C$27)...

  8. #8
    Forum Contributor
    Join Date
    11-11-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Lookup formula not working on certain cells

    The "junk" in B4 is used to remove the ASCII codes that inhibit me from being able to do the lookup...

    Thanks for the help. I'll have a look

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Lookup formula not working on certain cells

    Good deal. Thanks for the feedback!

  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: Lookup formula not working on certain cells

    it still has to be sorted tony, longest string last ,evaluate attached
    Attached Files Attached Files

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Lookup formula not working on certain cells

    Quote Originally Posted by martindwilson View Post
    it still has to be sorted
    It depends on whether there are similar keywords/phrases being looked up.

    In this case there are many similarities so the order of the keywords/phrases is critical.

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

    Re: Lookup formula not working on certain cells

    agreed if there is no overlapping fine but its easy to overlook!

+ 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. Correct/Working (Index,Match) formula not working between cells
    By barnerd in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 02-11-2014, 01:20 PM
  2. Using the lookup formula but is not working correctly
    By susiesc in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-31-2013, 03:38 PM
  3. v lookup formula not working?
    By Lornabol in forum Excel General
    Replies: 6
    Last Post: 04-19-2011, 01:46 PM
  4. same lookup function working in some cells not others
    By Jerhansen277 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-19-2007, 04:05 PM
  5. LOOKUP formula not working right
    By pdgaustintexas in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-27-2006, 11:22 AM

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