Extracting text from a formula?

R

Richard m

I have the following in a cell:

=-This is test

the above was imported from another program and I want to extract the
text part so I have *This is Text* as text.

I have tried functions and code. The last code is and it did not
work.


Code:
 
A

A.W.J. Ales

Richard,

From your text I understand that your cell contains both the =ans the - sign
as well as the text.

If so (assume your cell is G2) this formula should work for you :

=RIGHT(G2,LEN(G2)-2)

--
Regards,
Auk Ales

* Please reply to this newsgroup only *
* I will not react on unsolicited e-mails *
 
R

Richard m

Hi,

I've tried it all but have not been able to pull the text part out o
the formula.

the right() function does not seem to work with formulas. and the

Code:works only part of the time. Right now the cell displays #Name? an
the above code just shows the #Name? and the formula box shows th
text.

So I am still back to square one and looking for a solution
 
A

A.W.J. Ales

Richard,

The #NAME indicates that there actually is a formula ( -This is text)
which Excel doesn't recognize)

To solve it : Select the cells ; Edit / Find / in the Find what put =-
and in the Replace box put nothing ( thus empty) ; make sure that the Match
entire cell contents is unchecked and press the button Replace.

This removes =- from your "formula" and leaves the text in the cell.

--
Regards,
Auk Ales

* Please reply to this newsgroup only *
* I will not react on unsolicited e-mails *
 
R

Richard m

Thanks Auk,

My mind was somewhere else and I was trying to make it harder then i
was
 
A

A.W.J. Ales

YW Richard. it's always nice to hear things have been solved.
As far as complicating things is concerned, it happens me as well sometimes.
So dont't worry.

--
Regards,
Auk Ales

* Please reply to this newsgroup only *
* I will not react on unsolicited e-mails *
 

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

Top