delete a word from end of a text

  • Thread starter Thread starter Rasoul Khoshravan
  • Start date Start date
R

Rasoul Khoshravan

I have a column of texts. All of texts have the word "function" at end of
them.
I want to delete this word from end of all texts.
How can I do it.
 
Hi gary, Mr. Rasoul has a tricky question....watch out for the advice if
there is a word "function" in the beginning or mid of the text in any
colum----result may be devastating for him? maybe u can suggest some basic
formula.
 
Slight correction, Gary:

=trim(left(A1,right(A1,len(A1)-8)))

Hope this helps.

Pete
 
I'm not convinced that it does help, Pete, or Gary.

In your formula
right(A1,len(A1)-8))
will remove the first 8 letters from the text string, and give you the
remaining right-hand end of the string.

You are then using that string as the second argument for the left function,
which not surprisingly returns a #value error.

Perhaps you intended to suggest
=TRIM(LEFT(A1,LEN(A1)-8))
 
Yes, you're right David -I just spotted trimleft in Gary's posting and
thought that isn't a function!

Pete
 
=TRIM(IF(RIGHT(A2,8)="function",SUBSTITUTE(A2,RIGHT(A2,8),""),A2))
 
If you only want to remove "function" from the end of a cell...

Try this:

With
A1: (any value or blank)
B1: =TRIM(IF(COUNTIF(A1,"*function"),LEFT(A1,LEN(A1)-8),A1))

Example:
Using A1: This function is my function
The formula returns: This function is my

Does that help?
***********
Regards,
Ron

XL2002, WinXP
 
Hi again Rasoul....pls check up the best reply for you..so we all learn over
this thread....tks all..
 
Thanks for replies.

Pete_UK said:
Yes, you're right David -I just spotted trimleft in Gary's posting and
thought that isn't a function!

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top