Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if cell contains Non-Alpha characters in Excel

Tags:

Is there a Non-VBA way to check Col B and Col C to see if they contains any characters that are Non-Alpha? Just to clarify by Non-Alpha I mean anything not part of the alphabet(case insensitive).

Col B and Col C is a list of First and Last Names. Some of these names have symbols or numbers in them through bad data entry. I am trying to find all the ones that need to be fixed. So I need to find the ones that contain ANYTHING that is not a letter.

like image 735
Chad Portman Avatar asked Apr 24 '15 19:04

Chad Portman


People also ask

How do I find non alpha characters in Excel?

Using FIND will ensure wildcard characters "?~*" are identified as non-letter characters. You can put any character in the "abc... xyz" string. This makes it easy to test of alphanumeric, or common punctuations, etc.

How do you check if a cell is alphanumeric in Excel?

Press Alt + F11 and create a new module. The AlphaNumeric function will return TRUE if all of the values in the string are alphanumeric. Otherwise, it will return FALSE.

How do you check if a cell contains a special character in Excel?

The Excel ISNUMBER function returns TRUE when a cell contains a number, and FALSE if not. You can use ISNUMBER to check that a cell contains a numeric value, or that the result of another function is a number. The Excel FIND function returns the position (as a number) of one text string inside another.

How do you remove non alpha characters from a cell in Excel?

Select the range that you need to remove non-alphanumeric characters from, and click Kutools > Text > Remove Characters. 2. Then a Delete Characters dialog box will appear, only check Non-alphanumeric option, and click the Ok button. Now all of the non-alphanumeric characters have been deleted from the text strings.


1 Answers

There is a "weird" but simple and generic answer.

=SUMPRODUCT(SEARCH(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1),"abcdefghijklmnopqrstuvwxyz")) 
  • This formula returns #VALUE! error if A1 contains any non-letter characters, number if A1 contains only letters, or #REF! error if A1 is blank.

  • You can enclose this formula in an ISNUMBER or ISERR to convert this to a TRUE/FALSE value.

  • Replace the SEARCH with a FIND to make it case sensitive. Using FIND will ensure wildcard characters "?~*" are identified as non-letter characters.

  • You can put any character in the "abc...xyz" string. This makes it easy to test of alphanumeric, or common punctuations, etc.

The "1:"&LEN(A1) means that starting from the first letter, all the way to the last letter will be checked. Changing that to "2:"&(LEN(A1)-1) will not check the first and last letters.

like image 177
Roobie Nuby Avatar answered Dec 04 '22 12:12

Roobie Nuby