Can detect if cell have special character

shacol03

New Member
Joined
Oct 24, 2017
Messages
18
Office Version
  1. 365
Platform
  1. Windows
Hi All,

Please help me how to detect if cell contains special character ( please see below sample)

[TABLE="width: 200"]
<tbody>[TR]
[TD]SKN St. Pölten II[/TD]
[TD]True[/TD]
[/TR]
[TR]
[TD]Guaros De Lara[/TD]
[TD]False[/TD]
[/TR]
[TR]
[TD]Detroit Pistons[/TD]
[TD]False[/TD]
[/TR]
[TR]
[TD]Uni Györ [/TD]
[TD]True[/TD]
[/TR]
[TR]
[TD]Charlotte Hornets[/TD]
[TD]False[/TD]
[/TR]
</tbody>[/TABLE]

Thanks & Regards,
Roy
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Hi All,

Please help me how to detect if cell contains special character ( please see below sample)

[TABLE="width: 200"]
<tbody>[TR]
[TD]SKN St. Pölten II[/TD]
[TD]True[/TD]
[/TR]
[TR]
[TD]Guaros De Lara[/TD]
[TD]False[/TD]
[/TR]
[TR]
[TD]Detroit Pistons[/TD]
[TD]False[/TD]
[/TR]
[TR]
[TD]Uni Györ [/TD]
[TD]True[/TD]
[/TR]
[TR]
[TD]Charlotte Hornets[/TD]
[TD]False[/TD]
[/TR]
</tbody>[/TABLE]
What is your definition of "special character"... any non-letter, non-digit?

Also, are you looking for a formula or VBA solution.
 
Upvote 0
yes sir, any non-letter and non-digit

I just want a formula sir.
Give this formula a try...

=SUMPRODUCT(0+(MID(UPPER(A1),ROW(INDIRECT("A1:A"&LEN(A1))),1)>="A")*(MID(UPPER(A1),ROW(INDIRECT("A1:A"&LEN(A1))),1)<="Z")+ISNUMBER(-MID(UPPER(A1),ROW(INDIRECT("A1:A"&LEN(A1))),1))+(MID(UPPER(A1),ROW(INDIRECT("A1:A"&LEN(A1))),1)=" "))=LEN(A1)
 
Upvote 0
Give this formula a try...

=SUMPRODUCT(0+(MID(UPPER(A1),ROW(INDIRECT("A1:A"&LEN(A1))),1)>="A")*(MID(UPPER(A1),ROW(INDIRECT("A1:A"&LEN(A1))),1)<="Z")+ISNUMBER(-MID(UPPER(A1),ROW(INDIRECT("A1:A"&LEN(A1))),1))+(MID(UPPER(A1),ROW(INDIRECT("A1:A"&LEN(A1))),1)=" "))=LEN(A1)



Hi Sir,

Thank you so much !! this is worked !!

:):) im happy now
 
Upvote 0
Another option :

=NOT(ISERR(SUMPRODUCT(SEARCH(MID(A2,ROW(INDIRECT("1:"&LEN(A2))),1),"abcdefghijklmnopqrstuvwxyz0123456789"))))
@admiral100,

I like this solution much better than mine, however, you need to make one change to it. I know the OP said letters and digits, but based on his example, spaces are also allowed, so you have to add a space character somewhere (probably at the end) to the quoted string of letters and digits. Since I expect the OP will be copying the formula down through a lot of cells, I made one other change (which I should have made to my formula as well, but didn't)... I removed the Volatile INDIRECT function call and replaced it with a non-Volatile equivalent (see what is highlighted in red above and below)...

=NOT(ISERR(SUMPRODUCT(SEARCH(MID(A2,ROW(INDEX(A:A,1):INDEX(A:A,LEN(A2))),1),"abcdefghijklmnopqrstuvwxyz0123456789 "))))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,260
Members
452,627
Latest member
KitkatToby

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