Thread: Trim Function
View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Trim Function

you could use substitute. search the text string for ' and replace with ""
(empty string).

The general syntax would be:
=Substitute(TextString, "'","")

Using your specific formula in the place of TextString:
=SUBSTITUTE(UPPER(TRIM(LEFT(A2,MIN(FIND({0,1,2,3,4 ,5,6,7,8,9,"("},A2&"0123456789("))-1))),"'","")


"Saxman" wrote:

On 01/08/2007 15:15:33, "Saxman" wrote:
On 01/08/2007 04:50:00, JMB wrote:
=UPPER(TRIM(LEFT(A2,MIN(FIND({0,1,2,3,4,5,6,7,8,9, "("},A2&"0123456789("))-1)))


This appears to work fine ATM.

I'm very grateful to you and all.


Just had a thought. Never asked because I never thought it was possible. To
the above function could one remove any apostrophes ( ' ) anywhere in the
actual name?

i.e.

Dewar's Gold = DEWARS GOLD
Bob's Your Uncle = BOBS YOUR UNCLE
King's Diamond = KINGS DIAMOND