+ Reply to Thread
Results 1 to 18 of 18

Is there a search or filter function that works on partial results for strings?

  1. #1
    Registered User
    Join Date
    10-16-2022
    Location
    Sweden
    MS-Off Ver
    2209
    Posts
    9

    Is there a search or filter function that works on partial results for strings?

    Hi, I am a novice Excel user who's trying to learn by making a little database of some people in my ancestry.
    I'm trying to implement a search function (search box) with which I can easily search for partial matches.
    I have a list of different spellings of the same name, and I want to be able to find most of them by searching for only one of them.
    Say we have the names Catherine, Catherin, Katrin, Kathrin, Katrine, and I type in Katrin, then I want all of the different spellings to be found through perhaps a percentage match.
    Is there anything like this I can use in Excel?
    Attached Files Attached Files

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,410

    Re: Is there a search or filter function that works on partial results for strings?

    you could try the attached method - type in the combobox it will filter its content as you type.
    Attached Files Attached Files
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  3. #3
    Registered User
    Join Date
    10-16-2022
    Location
    Sweden
    MS-Off Ver
    2209
    Posts
    9

    Re: Is there a search or filter function that works on partial results for strings?

    Posted my reply wrong...
    Last edited by Koare; 10-16-2022 at 06:19 PM.

  4. #4
    Registered User
    Join Date
    10-16-2022
    Location
    Sweden
    MS-Off Ver
    2209
    Posts
    9

    Re: Is there a search or filter function that works on partial results for strings?

    Thank you for your reply!

    I've already played around with filtering the results normally, and while it's good, it's not what I need.
    My database is going to be pretty large, and I'd like to be able to sort out people with similar names like based on a percentage match of the search string.
    I've looked at "Fuzzy lookup" and it seems like what I want. But I'd like it in the shape of a formula, appliable to a searchbox.

  5. #5
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Is there a search or filter function that works on partial results for strings?

    I found my very old solution so maybe it will help

    A2 and down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    B2 and down: your list to search
    C2 and down (result):
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Defined name ValidationList in Data Validation List:
    Formula: copy to clipboard
    Please Login or Register  to view this content.




    if it will help hit Add Reputation at the bottom left side of the post
    Last edited by sandy666; 10-17-2022 at 02:54 AM. Reason: update file

  6. #6
    Registered User
    Join Date
    10-16-2022
    Location
    Sweden
    MS-Off Ver
    2209
    Posts
    9

    Re: Is there a search or filter function that works on partial results for strings?

    Hi, thanks for the response!

    I fail to see how this is anything different to just using a filter function such as
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I'm looking for some formula/function that can find matches based on a portion of the search string. Like finding "Catherine" by typing "Katrin" for example, because they have 5 out of 6 letters in common.

  7. #7
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Is there a search or filter function that works on partial results for strings?

    to whom is your post #6 ?

  8. #8
    Registered User
    Join Date
    10-16-2022
    Location
    Sweden
    MS-Off Ver
    2209
    Posts
    9

    Re: Is there a search or filter function that works on partial results for strings?

    Quote Originally Posted by sandy666 View Post
    to whom is your post #6 ?
    I responded to you

  9. #9
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Is there a search or filter function that works on partial results for strings?

    so use @[username] eg. @sandy

    so if you know what to use why asking about help?

  10. #10
    Registered User
    Join Date
    10-16-2022
    Location
    Sweden
    MS-Off Ver
    2209
    Posts
    9

    Re: Is there a search or filter function that works on partial results for strings?

    Sorry Sandy, I'm not used to using forums haha.
    Also I couldn't use the [at] symbol, because the site thinks that I am sending a "link, image or video" which I am not allowed to do until I've posted a few times :P

    I know what I want, but I don't know how I can do it.
    A simple filter function is not enough, as I've stated before.
    I'll explain one more time

    I want to have a function that when you input a full string into a textbox, for example "Katrin" it searches for:
    A. Every person called Katrin
    B. Every person with a name similar to Katrin with a different spelling, such as "Catherine, which has 5 out of 6 letters similar

    The filter function only filters names that has the exact string "Katrin" within it. Such as "Katrine". But it will not find anything that is just a little bit different, such as "Catrin".
    That's why I want to base the search upon results that have similarities with the inputted string, and not exact matches with the string.

    I hope I made it clear. It is difficult for me to explain it

  11. #11
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Is there a search or filter function that works on partial results for strings?

    @ space username

    Katrine <> Catrin
    common characters , in this case, are atrin so you need for more Katrins use common characters as I did: at

    here is another way via Power Query

    Result
    Catherine
    Catherin
    Katrin
    Kathrin
    Katrine
    Katelyn Berry
    Whoopi Fitzpatrick
    Wilma Watkins
    Ignacia Mathews
    Matthew Fuentes

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    10-16-2022
    Location
    Sweden
    MS-Off Ver
    2209
    Posts
    9

    Re: Is there a search or filter function that works on partial results for strings?

    sandy666
    Thanks again for the reply,
    I can't use the [at] symbol as the site tells me I am not allowed to.

    I think we are going in circles. If I have a database of potentially 10s of thousands of people, with 10 different spellings of catherin. Searching for only "At" will not help that much.
    There will be so many people who will show up as a result that it would just be more efficient to search for each different spelling.
    Also, to me it is very logical what you're saying. But I wont be the person who will use the search function. It will be my father who is too old to think about "common letters" in the names while typing his search string.

  13. #13
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Is there a search or filter function that works on partial results for strings?

    I gave you two solutions that work
    If you are not happy - wait for someone else for solution you want

    Have a nice day

  14. #14
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Is there a search or filter function that works on partial results for strings?

    Does this provide a starting point?

    =SUM(--(IFERROR(MATCH(MID(A2,SEQUENCE(LEN(A2)),1),MID($D$2,SEQUENCE(LEN($D$2)),1),0),0)>0))/LEN($D$2)
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  15. #15
    Registered User
    Join Date
    10-16-2022
    Location
    Sweden
    MS-Off Ver
    2209
    Posts
    9

    Re: Is there a search or filter function that works on partial results for strings?

    Thank you for your response Glenn!
    This does seem very intriguing. It seems to base the match % off of the amount of letters that the search string has in common with the names which is a great starting point!
    However I don't really understand the formula, so I don't know how I would apply this to a FILTER function or a table, as in filtering out everything below say a 50% match.
    It only seems applicable to a single cell at a time.
    Or would you be so kind and explain it a little bit further?

  16. #16
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Is there a search or filter function that works on partial results for strings?

    It's simply the % of the letters in D2 that are present in A2, A3, etc. I suppose you could then decide on a cut-off and use:

    =FILTER(A2:A10,B2:B10>0.6)

    You could also probably refine it all a bit by requiring the a column words to BEGIN with C or K....
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    10-16-2022
    Location
    Sweden
    MS-Off Ver
    2209
    Posts
    9

    Re: Is there a search or filter function that works on partial results for strings?

    I don't know what to make of it. I am able to filter them as you said.
    But I can't apply this to a table, if I convert the names list to a table called "Table" and try to use the formula, it's not working.

    =SUM(--(IFERROR(MATCH(MID(Table[Names];SEQUENCE(LEN(Table[Names]));1);MID($D$2;SEQUENCE(LEN($D$2));1);0);0)>0))/LEN($D$2)

    I'd assume this is because of the SUM function summing it up into one cell, but I would like it to sum every row of the table without having to apply the function manually to every row.

    I hope you understand my question. It's really hard to explain haha
    Attached Files Attached Files

  18. #18
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Is there a search or filter function that works on partial results for strings?

    Set up a Named Range (CTRL-F3) called RemoveChars:

    =LAMBDA(data,chars,IF(chars="",data,RemoveChars(SUBSTITUTE(data, LEFT(chars,1),""),RIGHT(chars,LEN(chars)-1))))

    Then use:

    =LET(d,Table[Names],c,I2,(LEN(d)-LEN(RemoveChars(d,c)))/LEN(c))
    Attached Files Attached Files

+ 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. Compare 2 partial strings against each other within FILTER function?
    By stonechitlin in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-16-2022, 01:48 AM
  2. [SOLVED] Search Partial Match and return results on form
    By Andy C. in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 02-05-2022, 05:43 PM
  3. [SOLVED] Partial Match Search Results on User Form
    By matt7416 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-25-2020, 05:01 AM
  4. [SOLVED] Search Bank Statement Lines for Partial Strings Stored in Reference Table
    By Bob_W in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-07-2020, 12:18 PM
  5. [SOLVED] Advance filter or filter to get partial strings
    By jaryszek in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-22-2020, 01:33 PM
  6. Formula/vba to search partial strings in other sheet
    By kevivu in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-28-2015, 05:55 AM
  7. [SOLVED] Search for a partial string match and cycle through matching results
    By kamelkid2 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-08-2013, 08:27 AM

Tags for this Thread

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