Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Truncate / Substitute Formulas

Is there a formula that removes everything except numbers from a cell? For
example, if a cell contained the text FW345A-A the formula would return the
value 345. I got it to somewhat work using SUBSTITUTE on top of itself, but
there seems to be a limit in the number of characters you can add to the
string. It won't let you add all 26 letters and the dash.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Truncate / Substitute Formulas

FW345A-A

Are the numbers to extract *ALWAYS* together?

Will there ever be strings like this:

F5W345A-1
1-FW345A-A
FW34A5A-A

--
Biff
Microsoft Excel MVP


"Jason W" <Jason wrote in message
...
Is there a formula that removes everything except numbers from a cell?
For
example, if a cell contained the text FW345A-A the formula would return
the
value 345. I got it to somewhat work using SUBSTITUTE on top of itself,
but
there seems to be a limit in the number of characters you can add to the
string. It won't let you add all 26 letters and the dash.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,203
Default Truncate / Substitute Formulas

See this page:
http://office.microsoft.com/en-au/ex...549011033.aspx
At the end of the article you'll have this formula (which would be in a cell
like B1 or C1 and refers to a value such as FW345A-A in cell A1):
=1*MID(A1,MATCH(TRUE,ISNUMBER(1*MID(A1,ROW($1:$9), 1)),0),COUNT(1*MID(A1,ROW($1:$9),1)))

Note that it is an array formula, so you must 'commit' it with
[Shift]+[Ctrl]+[Enter] so that it ends up looking like
{=1*MID(A1,MATCH(TRUE,ISNUMBER(1*MID(A1,ROW($1:$9) ,1)),0),COUNT(1*MID(A1,ROW($1:$9),1)))}
in the formula bar. You can now fill that formula down the sheet as far as
you need to take it.

So, thanks to Ashish Mathur, there is a solution.

"Jason W" wrote:

Is there a formula that removes everything except numbers from a cell? For
example, if a cell contained the text FW345A-A the formula would return the
value 345. I got it to somewhat work using SUBSTITUTE on top of itself, but
there seems to be a limit in the number of characters you can add to the
string. It won't let you add all 26 letters and the dash.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default Truncate / Substitute Formulas

You need to tell us more about your values. For example... Are the numbers
always 3 digits long? Does the number always start at position 3 in the
text? Will there ever be other numbers in the text (such as FW345A-A67B)
and, if so, what do you want to do with them? Anything else you can think of
that will describe what you have and what you want to get from it?

--
Rick (MVP - Excel)


"Jason W" <Jason wrote in message
...
Is there a formula that removes everything except numbers from a cell?
For
example, if a cell contained the text FW345A-A the formula would return
the
value 345. I got it to somewhat work using SUBSTITUTE on top of itself,
but
there seems to be a limit in the number of characters you can add to the
string. It won't let you add all 26 letters and the dash.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I combine two formulas Left/Mid/Right + Substitute? SCrowley Excel Worksheet Functions 8 May 11th 23 11:44 AM
how do I substitute precedants in long excel formulas ognavtra Excel Worksheet Functions 1 April 17th 09 01:39 PM
Find and Replace/Substitute Formulas Kathy123 Excel Worksheet Functions 4 December 12th 08 12:24 AM
Need Help with Substitute Formulas, etc. ISAF Media Analysis[_2_] Excel Discussion (Misc queries) 5 September 1st 08 05:44 PM
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE.... max. limit 8 :( [email protected] Excel Discussion (Misc queries) 6 May 22nd 08 05:33 PM


All times are GMT +1. The time now is 10:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"