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)

SKN St. Pölten IITrue
Guaros De LaraFalse
Detroit PistonsFalse
Uni Györ True
Charlotte HornetsFalse

<tbody>
</tbody>

Thanks & Regards,
Roy
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Hi All,

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

SKN St. Pölten IITrue
Guaros De LaraFalse
Detroit PistonsFalse
Uni Györ True
Charlotte HornetsFalse

<tbody>
</tbody>
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,215,329
Messages
6,124,302
Members
449,150
Latest member
NyDarR

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