Finding names containing letters

Buckeroo

New Member
Joined
Jul 19, 2022
Messages
10
Office Version
  1. 365
  2. 2021
  3. 2019
Platform
  1. Windows
I have a list of names, and I want to find names containing certain letters. But I want it to find the names with the letters in no particular order. My current function is
=FILTER(A1:A50, REGEXMATCH(A1:A50, E20))
With it filtering through the names from A1 to A50, and E20 is where the letters are input. If I put "Z" into the input, it will return with the names "Choronzon, Niyaz, Itzpapalotl, Pazuzu". But if I put "ZN" it will come out with nothing. However, I want it to output "Choronzon, Niyaz". Thanks for the help!
 
Depends on the syntax you are using. What is going to be in the cell? Just the letters, like
nz
?
 
Upvote 0

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
I mean how many letters would you want to enter to match on. nz has 2. Will it always be 2?
 
Upvote 0
I cannot imagine how to write a simple formula that takes a string of 1-14 letters, and produces a regular expression that will match all of the letters but in any order and any position in the target string. I am not even sure how to do that in a regexp. In Excel I would be doing that using VBA, but am not familiar with Google Sheets scripting language.
 
Upvote 0
I cannot imagine how to write a simple formula that takes a string of 1-14 letters, and produces a regular expression that will match all of the letters but in any order and any position in the target string. I am not even sure how to do that in a regexp. In Excel I would be doing that using VBA, but am not familiar with Google Sheets scripting language.
Can you explain how to do that in excel then? My buddy does not have excel, but I do, and I could try to figure something out.
 
Upvote 0
I have found the solution formula. Here it is.

Rich (BB code):
=FILTER(A1:A50, REGEXMATCH(A1:A50, MID(E20,1,1))*REGEXMATCH(A1:A50, MID(E20,2,1))*REGEXMATCH(A1:A50, MID(E20,3,1))*REGEXMATCH(A1:A50, MID(E20,4,1))*REGEXMATCH(A1:A50, MID(E20,5,1))*REGEXMATCH(A1:A50, MID(E20,6,1))*REGEXMATCH(A1:A50, MID(E20,7,1))*REGEXMATCH(A1:A50, MID(E20,8,1))*REGEXMATCH(A1:A50, MID(E20,9,1)))
 
Upvote 0
Solution
You are checking for 9 letters here but said there could be up to 14.
 
Upvote 0

Forum statistics

Threads
1,223,336
Messages
6,171,524
Members
452,409
Latest member
brychu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top