Check if cell contains Non-Alpha characters in Excel

前端 未结 2 548
别那么骄傲
别那么骄傲 2020-12-09 10:01

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 alpha

2条回答
  •  眼角桃花
    2020-12-09 10:23

    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.

    • 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.

提交回复
热议问题