+ Reply to Thread
Results 1 to 12 of 12

Index and Match

  1. #1
    Registered User
    Join Date
    07-14-2015
    Location
    Canada
    MS-Off Ver
    MS365 Version 2209
    Posts
    49

    Index and Match

    Good Day,

    I am trying to figure out why my formula is not working. as you can see in the attached, I have Column C with names and D with their "Abbreviations" of course nothing official but When I type Pear into the searching for field, the Result shows up as NEC, indicating Nectarine. Why? As well, how would I search for Grapes instead of Grape?

    The later is my bigger issue atm. I have a real sheet that keeps giving me line 142 instead of 143 where it should be. I can't search exact, but if I absolutely MUST, I will create a dropdown but at 178 items, that is excessive for a dropdown.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Index and Match

    Your MATCH function would benefit from a third term to specify an exact match:

    =INDEX(D1:D6,MATCH(D8,C1:C6,0))

  3. #3
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Index and Match

    I should finish reading the entire question next time...

  4. #4
    Registered User
    Join Date
    07-14-2015
    Location
    Canada
    MS-Off Ver
    MS365 Version 2209
    Posts
    49

    Re: Index and Match

    NP but thanks for the quick reply anyways.

  5. #5
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Index and Match

    Try searching exact with a wildcard:

    =INDEX(D1:D6,MATCH(D8&"*",C1:C6,0))

    Will make the match for grape in D8 even if C3 says grapes. Using a non-exact match is really only useful for numbers that are in order or text in alphabetical order.

  6. #6
    Registered User
    Join Date
    07-14-2015
    Location
    Canada
    MS-Off Ver
    MS365 Version 2209
    Posts
    49

    Re: Index and Match

    All my text will be in order, I just have a long list of unique names to get through, but it's just not matching correctly, I will try this though and get back to you.

  7. #7
    Registered User
    Join Date
    07-14-2015
    Location
    Canada
    MS-Off Ver
    MS365 Version 2209
    Posts
    49

    Re: Index and Match

    It didn't work in my real sheet, I put something like grap and it failed the search.

  8. #8
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Index and Match

    Failed as in error? Or failed as in it returned "grapefruit"? It should return the first match that starts with the search term ("grap")
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Index and Match

    Here's a more robust, if slightly ridiculous-looking, version:

    =IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(INDEX(D1:D6,MATCH(D8,C1:C6,0)),INDEX(D1:D6,MATCH(D8&"s",C1:C6,0))),INDEX(D1:D6,MATCH(LEFT(D8,LEN(D8)-1),C1:C6,0))),INDEX(D1:D6,MATCH(SUBSTITUTE(D8,"ies","y"),C1:C6,0))),INDEX(D1:D6,MATCH(LEFT(D8,LEN(D8)-1)&"ies",C1:C6,0))),INDEX(D1:D6,MATCH(D8&"*",C1:C6,0)))

    It first looks for a perfect match. Failing that, it adds an "s" to the search term and tries again. Failing that, it subtracts the final letter from the search term and tries again (in case the search term is plural but the list term isn't). Failing that, it replaces "ies" with "y" and searches. Failing that, it does the reverse, replacing the last letter with "ies". Finally, it does the general "starts with..." search that I proposed earlier. Not quite perfect, but it should be close.

  10. #10
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Index and Match

    Hello Tordah,

    Try this version:

    =INDEX(D:D,LOOKUP(2^20,MATCH(MID(D8,1,ROW(INDEX(A:A,1):INDEX(A:A,LEN(D8))))&"*",C:C,0)))
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  11. #11
    Registered User
    Join Date
    07-14-2015
    Location
    Canada
    MS-Off Ver
    MS365 Version 2209
    Posts
    49

    Re: Index and Match

    Quote Originally Posted by Haseeb A View Post
    Hello Tordah,

    Try this version:

    =INDEX(D:D,LOOKUP(2^20,MATCH(MID(D8,1,ROW(INDEX(A:A,1):INDEX(A:A,LEN(D8))))&"*",C:C,0)))
    I do not understand the index(A:A,1):index(A:A, portion is for, why A:A? is this a dump column?

  12. #12
    Registered User
    Join Date
    07-14-2015
    Location
    Canada
    MS-Off Ver
    MS365 Version 2209
    Posts
    49

    Re: Index and Match

    Haseeb,

    Thank you for that, I did get it to works mostly, but I can edit the couple that are just not working for me. At least it is about 5 compared to the 178 from before.

    Again, 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] INDEX+MATCH instead of VLOOKUP+MATCH, why is INDEX a better choice and how to re-write?
    By Renejorgensen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-23-2016, 10:54 AM
  2. [SOLVED] Index / Match - match 3 input values and return the results from the index
    By t83357 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-08-2016, 07:34 PM
  3. [SOLVED] Match-Index in stead of Index-Match lookup Array among Arrays
    By Numnum in forum Excel General
    Replies: 2
    Last Post: 10-15-2015, 02:08 PM
  4. INDEX MATCH MATCH/OFFSET MATCH MATCH with named ranges
    By Andrew-Mark in forum Excel General
    Replies: 3
    Last Post: 02-27-2015, 10:56 PM
  5. Replies: 6
    Last Post: 04-30-2014, 02:42 AM
  6. Replies: 6
    Last Post: 11-08-2013, 10:29 PM
  7. Replies: 3
    Last Post: 05-02-2013, 01:31 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