Retriving text from a column

  • Thread starter Thread starter JAF-In
  • Start date Start date
J

JAF-In

how can i retrieve text from one column to another except one last word
for eg:The text "how can i retrieve text from" is in column A1 and i have to
retrieve "how can i retrieve text" to B1
 
JAF-In said:
how can i retrieve text from one column to another except one last word
for eg:The text "how can i retrieve text from" is in column A1 and i have to
retrieve "how can i retrieve text" to B1


Try...

=LEFT(A1,FIND("^^",SUBSTITUTE(A1," ","^^",LEN(A1)-LEN(SUBSTITUTE(A1,"
",""))))-1)
 
Try this
=SUBSTITUTE(A1,TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",99)),99)),"")

You should encase that in a TRIM function in order to get rid of the space
that is in front of that last word...

=TRIM(SUBSTITUTE(A1,TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",99)),99)),""))
[/QUOTE]
 
Try

=TRIM(SUBSTITUTE(A1,TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",99)),99)),))

If this post helps click Yes
 
You right, because I was removing spaces with the inner part of the formula

=TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",99)),99))

I never realised I would get the last space back when using the extracted
string in the outer substitute part, nice spot.

Mike
 

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