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!
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
REGEXMATCH is not a built-in Excel function (at least not in my version of Excel 365). Where are you getting that?

If you can use RegEx for the pattern, instead of ZN use
Excel Formula:
zn|nz
 
Upvote 0
REGEXMATCH is not a built-in Excel function (at least not in my version of Excel 365). Where are you getting that?

If you can use RegEx for the pattern, instead of ZN use
Excel Formula:
zn|nz
Ah sorry, my friend gave me that message and I just sent it here cause I do not know much. He did not tell me it was used in Google Sheets. Sorry for the inconvenience! Do you have any recommendations on where I could get help for Google Sheets?
 
Upvote 0
I am not familiar with Google Sheets so much but I do know regex and my answer should still be valid.
 
Upvote 0
I am not familiar with Google Sheets so much but I do know regex and my answer should still be valid.
With your solution, wouldnt it only show names with zn and nz, in that order? The names that are shown need to contain those letters, not in any order.
 
Upvote 0
Your specification is not really very specific. Is "Choronzon, Niyaz" one name (last, first) or two names? It looks like you matched it because of "nz".

I am starting to think that you mean:

"Find all words that contain the letter n and the letter z, anywhere in the word, in any order."

In that case:

Excel Formula:
z.*n|n.*z

or possibly

Excel Formula:
(z.*)?n(z.*)?

I suspect you also need a match that is case-insensitive. I do not know how to specify that in Google Sheets.
 
Upvote 0
Your specification is not really very specific. Is "Choronzon, Niyaz" one name (last, first) or two names? It looks like you matched it because of "nz".

"Find all words that contain the letter n and the letter z, anywhere in the word, in any order."

I suspect you also need a match that is case-insensitive. I do not know how to specify that in Google Sheets.
Yes, sorry, it is two different names, it does not matter if it is case-sensitive or not. And yes "Find all words that contain the letter n and the letter z, anywhere in the word, in any order." is correct. However the formula you gave me returns an error. "Formula parse error."
 
Upvote 0
Should be a valid regexp expression. I'll have to set up a test in Google Sheets.
 
Upvote 0
Should be a valid regexp expression. I'll have to set up a test in Google Sheets.
Yes, it is a valid expression, it did work, my buddy was putting it in wrong 😅. Is there any way to use one of those expressions, but pulling the letters from a cell? Thanks.
 
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