# How to delete a character from a cell

Hi,

I using excel XP and i had this simple problem. Example : My Cell A1 contains this text "0.251mV". How can i write a formula in Cell B1 such that the "mV" is deleted and in B1 Cell it is in scientific numbers format? I had also values like 0.2dB and 10.5W blar blar blar.... I just want to extract out their numbers and put it in another cell using a formula. Pls Help.
###### Who is Participating?

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
I'm not sure exactly what you need.  If A1 was 0.251mV, the Excel formula for this would look like:
=LEFT(A1,LEN(A1)-2)
This strips off the last 2 characters.  You can just use the RangePtr->Value to put the formula there.

To make it scientific format, set the NumberFormat to something like:
RangePtr->NumberFormat = "0.0000E+00"; // This would make it 4 decimal places.  5 would be 0.00000E+00, etc (the number of 0's after the 0.).  Good luck.
Author Commented:

Oh what i mean is to delete the mV characters which u have shown me how. But because my A1 cell might contains 0.2mV or 0.321mV or different decimal places. But i wish to write a formula for example B1 to automatically contain the numerical result of A1..  so....example :

A1 Cell : 0.231mV                           B1 Cell should be : 0.231 (in number format)
or     A1 Cell : 1.2mV                           B1 Cell should be : 1.2 (in number format) only
or     A1 Cell : 0.231132mV                  B1 Cell should be : 0.231132 (in number format) only

So is there any formula to take out the "mV" text only from A1?

Commented:
Actually, the formula that I gave you removes the last 2 characters, no matter how long the text is; so it will also delete the mV.

Experts Exchange Solution brought to you by