How to test for cells that contain a specific character set?

phaustin

New Member
Joined
Apr 17, 2012
Messages
8
Hello all!

I am trying to identify a list of last names and first names that contain any characters other than a uppercase letter, space or hyphen.

I've been reading the boards, and I see how to test for the existence of a *specific* character or string, but I want to test for characters that are not letters, spaces, or hyphens.

(As I sidenote, I'd like to also test for any cells that begin or end with a space, but I can probably figure that out.)

Thanks!
Pete
 
Here's another one...

Create ths named expression...

Name: Characters
Refers to: ="ABCDEFGHIJKLM- NOPQRSTUVWXYZ"

That space is intentional.

Then:

Book1
AB
2ASDfFALSE
3100FALSE
4xxxFALSE
5Z-ATRUE
6A PTRUE
7-TRUE
8TOM JONESTRUE
9J. TheisFALSE
Sheet1

This array formula** entered in B2 and copied down:

=COUNT(FIND(MID(A2,ROW(INDIRECT("1:"&LEN(A2))),1),Characters))=LEN(A2)

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.
 
Upvote 0
Brilliant!! I shall worship you; you are clearly a god.

You can always count on T. Valko to come up with something better - and simpler - than the solution you were getting ****y about ;)
 
Upvote 0
Brilliant!! I shall worship you; you are clearly a god.

You can always count on T. Valko to come up with something better - and simpler - than the solution you were getting ****y about ;)
Sometimes I get it right and sometimes I don't! :)
 
Upvote 0
I have it working, thank you all. I really appreciate it. You guys really really know what you are doing. Very awesome.

Of course, now I am about to post another question.....
 
Upvote 0
I have it working, thank you all. I really appreciate it. You guys really really know what you are doing. Very awesome.

Of course, now I am about to post another question.....
You're welcome. We appreciate the feedback! :cool:
 
Upvote 0

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