View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Stefi
 
Posts: n/a
Default Use a formula to delete part of a text string?

Say your text is in A2, then insert in B2:
=LEFT(A2,SEARCH("-brown",A2)-1)

Regards,
Stefi

€˛Josh Craig€¯ ezt Ć*rta:

Hi I was just wondering if I could use a formula to delete part of text in a
cell after a certain string of text appears within that cell where the number
of characters before the certain text varies for example:

Big Fat Cat-brown-2803
Small dog-brown-705
Large sheep-brown-106
Small cat-brown-1803

I was looking for a formula so that everything after "-brown" and "-brown"
itself is is deleted. I can only think how to do this where there is a
consistent number of characters before or after the phrase I want to delete,
but unfortunately I don't have that luxury.

Any advice would be greatly appreciated!