+ Reply to Thread
Results 1 to 16 of 16

Index Match Search Not Using Exact Match

  1. #1
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Index Match Search Not Using Exact Match

    Hello,

    In the attached file I have some macros that go through and rename pdf files that come out of our accounting system and then pushes a copy of the renamed file to another location. I have some search functionality in the file that searches for the entity name to figure out what the renaming is however if I have entities of similar names it will not find the exact match on the name but the first closest match. Any idea how I can change the formula in column H on the Rename Calculation Tab to do a search for the exact match to get the right naming? Cell H10 is the example where it isn't finding the right match. if you look at the yellow Tables (2) tab it has the entities NorthTown Mall and NorthTownMall_Co03104. It is picking up the first instance when it should grab the second.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: Index Match Search Not Using Exact Match

    Match finds the first matching value. Your match is looking for TRUE's. Your SEARCH() returns "61" for both "NorthTown Mall" and "NorthTownMall_Co03104", which your ISNUMBER converts to TRUE, and since "NorthTown Mall" comes first in the range, its the one being returned as TRUE is an exact match.

    EDIT: to be honest, not sure I understand the point of your INDEX(ISNUMBER(SEARCH. I understand what it does, just not sure what your goal is and if thats the right way to go about it.
    Ways to get help: Post clear questions, explain your overall goal, supply as much background as possible, respond to questions asked of you by those trying to help and post sample(s) files.

    "I am here to help, not do it for people" -Me

  3. #3
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Index Match Search Not Using Exact Match

    So our accounting system generates reports and gives them a very long report number with an odd description. This file does a search on the entity name and once it finds it it builds the path to rename the pdf file via macro. once renamed I then have a macro that moves a copy to a second path for reporting requirements. so the file does a search on the entity and report name to restructure the file path so it can rename it. the way that formula is working now i get a conflict because it wants to rename the second instance with a name that already exists. Is there a way around it so it picks up the second instance instead of the first?

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Index Match Search Not Using Exact Match

    Your match IS in fact using Exact Match, so it will return the first match.

    If you want it to return the last match, try
    =IFERROR(LOOKUP(2^15,SEARCH(lstSearchText2,$A10),lstSearchText2),"No")

  5. #5
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Index Match Search Not Using Exact Match

    would that work as a replacement though where it would pull the first item for the first one in the list and the second item for the second one?

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Index Match Search Not Using Exact Match

    As long as the table lstSearchText2 is sorted in a way that the more specific string is listed first...

    OK
    NorthTown Mall_Co03104
    NorthTown Mall


    NOT OK
    NorthTown Mall
    NorthTown Mall_Co03104

  7. #7
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Index Match Search Not Using Exact Match

    Wait, that's backwards.
    The more specific string should come last, which looks like the way you have it already.

    NOT OK
    NorthTown Mall_Co03104
    NorthTown Mall


    OK
    NorthTown Mall
    NorthTown Mall_Co03104

  8. #8
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Index Match Search Not Using Exact Match

    It works for some and breaks for others. I have some that have about 4 to 6 similar names.

  9. #9
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Index Match Search Not Using Exact Match

    For Example?

  10. #10
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Index Match Search Not Using Exact Match

    it isn't in the file i sent you however there are about 180 paths that I go through and rename. An example is the list below. It pulls Staten Island for every instance. Is there a way to add an exact formula or something?

    Staten Island Mall Phase II
    Staten Island Mall Phase I
    Staten Island Mall Wendys
    Staten Island Mall
    Staten Island The Crossings

  11. #11
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Index Match Search Not Using Exact Match

    and thank you very much for the assistance.

  12. #12
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Index Match Search Not Using Exact Match

    Those should be listed with the More specific strings last (doesn't have to be alphabetical)
    Staten Island Mall
    Staten Island Mall Wendys
    Staten Island Mall Phase I
    Staten Island Mall Phase II
    Staten Island The Crossings


    Sorting the data in Ascending order should take care of it.

  13. #13
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Index Match Search Not Using Exact Match

    what is weird is the original formula works for the Staten Island names just not the North Town name. And the formula you gave me fixes the North Town Name but breaks the Staten Island name

  14. #14
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Index Match Search Not Using Exact Match

    Did you re-arrange those items as I suggested?
    Can you attach a new sample?

  15. #15
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Index Match Search Not Using Exact Match

    you are the bomb. I believe that did it. I will test it out more later and let you know. Much appreciated.

  16. #16
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Index Match Search Not Using Exact Match

    You're welcome.

    Also make note, there can't be any blanks in the range lstSearchText2

+ 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. Using wildcards to get an exact match using vlookup or index and match
    By Martynw2005 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-15-2015, 09:56 PM
  2. [SOLVED] Working INDEX MATCH with SEARCH, but I need to add another MATCH to the formula!
    By DaveBre in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-11-2014, 01:03 AM
  3. Replies: 3
    Last Post: 06-17-2013, 12:37 PM
  4. [SOLVED] Index & Match returning incorrect value. Arrays fixed and exact match used.
    By SDes in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-07-2012, 08:29 PM
  5. Replies: 6
    Last Post: 01-28-2012, 06:59 PM
  6. Replies: 2
    Last Post: 01-28-2012, 05:26 PM
  7. [SOLVED] Lookup or index match for "contains" rather than exact match -- find/search?
    By Excel@shoenfeltconsulting.com in forum Excel General
    Replies: 2
    Last Post: 07-02-2006, 05:50 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