Hi,
I'm looking for a formula that can find and return only the special chars in a string.
Example:
String: µGUA BUFFET E LOCAċES LTDA
Return: µ ċ
Hi,
I'm looking for a formula that can find and return only the special chars in a string.
Example:
String: µGUA BUFFET E LOCAċES LTDA
Return: µ ċ
In that particular case you could use this:
=SUBSTITUTE(SUBSTITUTE(A1,"GUA BUFFET E LOCA",""),"ES LTDA","")
but I suspect you are looking for something more general. You could have a formula with 26 nested SUBSTITUTE functions, each eliminating a single letter, but you could do it more efficiently with a user-defined function (although that would involve a bit of VBA).
Hope this helps.
Pete
"Special characters" meaning everything except ... what?
Last edited by shg; 09-10-2012 at 03:31 PM.
Entia non sunt multiplicanda sine necessitate
Everything except A-Z a-z 0-9 and space
![]()
-------------A------------- -B- -------C-------- 1 µGUA BUFFET E LOCAċES LTDA µċ B1: =Special(A1)
![]()
Function Special(sInp As String) As String Static oRE As Object If oRE Is Nothing Then Set oRE = CreateObject("VBScript.RegExp") oRE.Global = True oRE.IgnoreCase = True oRE.Pattern = "[!A-X0-9 ]" End If Special = oRE.Replace(sInp, "") End Function
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks