Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Extract a number from a variable text string

I want to extract a number from a variable text string, ie the number is not
in a fixed position in the text string.

I want the numbers to be placed in a separate column so I can calculate the
median of the series.

E.g.
SB 118 Kenny St BV 6rm $415,000 Stockdale & Leggo Gladstone Park

should return the number 415,000

repeat for each row in the spreadsheet.

Any help appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Extract a number from a variable text string

Which number (there are three in your example):

118 ?
6 ?
425,000 ?
--
Gary''s Student - gsnu200783


"tipsy" wrote:

I want to extract a number from a variable text string, ie the number is not
in a fixed position in the text string.

I want the numbers to be placed in a separate column so I can calculate the
median of the series.

E.g.
SB 118 Kenny St BV 6rm $415,000 Stockdale & Leggo Gladstone Park

should return the number 415,000

repeat for each row in the spreadsheet.

Any help appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Extract a number from a variable text string

With just a single example to go by *maybe* this...

SB 118 Kenny St BV 6rm $415,000 Stockdale & Leggo Gladstone Park


Assuming the number to be extracted is *always* preceded by a $ sign and
followed by a space.

=--LEFT(MID(A1,FIND("$",A1),255),FIND(" ",MID(A1,FIND("$",A1),255))-1)


--
Biff
Microsoft Excel MVP


"tipsy" wrote in message
...
I want to extract a number from a variable text string, ie the number is
not
in a fixed position in the text string.

I want the numbers to be placed in a separate column so I can calculate
the
median of the series.

E.g.
SB 118 Kenny St BV 6rm $415,000 Stockdale & Leggo Gladstone Park

should return the number 415,000

repeat for each row in the spreadsheet.

Any help appreciated.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Extract a number from a variable text string

T.Valko, that works, thank you very much, the assumptions are correct.
I would now like to enhance the formula, such that it ONLY extracts the
number if the first two characters in the string are S , SA or SB.

Is this possible?
Thanks
tipsy

"T. Valko" wrote:

With just a single example to go by *maybe* this...

SB 118 Kenny St BV 6rm $415,000 Stockdale & Leggo Gladstone Park


Assuming the number to be extracted is *always* preceded by a $ sign and
followed by a space.

=--LEFT(MID(A1,FIND("$",A1),255),FIND(" ",MID(A1,FIND("$",A1),255))-1)


--
Biff
Microsoft Excel MVP


"tipsy" wrote in message
...
I want to extract a number from a variable text string, ie the number is
not
in a fixed position in the text string.

I want the numbers to be placed in a separate column so I can calculate
the
median of the series.

E.g.
SB 118 Kenny St BV 6rm $415,000 Stockdale & Leggo Gladstone Park

should return the number 415,000

repeat for each row in the spreadsheet.

Any help appreciated.




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Extract a number from a variable text string

Try this:

=IF(OR(LEFT(A1,2)={"S ","SA","SB"}),
--LEFT(MID(A1,FIND("$",A1),255),
FIND(" ",MID(A1,FIND("$",A1),255))-1),"")

All on one line.


--
Biff
Microsoft Excel MVP


"tipsy" wrote in message
...
T.Valko, that works, thank you very much, the assumptions are correct.
I would now like to enhance the formula, such that it ONLY extracts the
number if the first two characters in the string are S , SA or SB.

Is this possible?
Thanks
tipsy

"T. Valko" wrote:

With just a single example to go by *maybe* this...

SB 118 Kenny St BV 6rm $415,000 Stockdale & Leggo Gladstone Park


Assuming the number to be extracted is *always* preceded by a $ sign and
followed by a space.

=--LEFT(MID(A1,FIND("$",A1),255),FIND(" ",MID(A1,FIND("$",A1),255))-1)


--
Biff
Microsoft Excel MVP


"tipsy" wrote in message
...
I want to extract a number from a variable text string, ie the number is
not
in a fixed position in the text string.

I want the numbers to be placed in a separate column so I can calculate
the
median of the series.

E.g.
SB 118 Kenny St BV 6rm $415,000 Stockdale & Leggo Gladstone Park

should return the number 415,000

repeat for each row in the spreadsheet.

Any help appreciated.






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
extract text from string AskExcel Excel Worksheet Functions 2 October 9th 07 06:54 AM
Extract number from text/number string.. nastech Excel Discussion (Misc queries) 5 July 5th 06 11:21 PM
Extract text from String Dan Excel Worksheet Functions 8 July 1st 06 12:39 PM
How to extract the Number from a String johnbest New Users to Excel 3 December 19th 05 06:23 PM
Extract % from text string Mike Excel Worksheet Functions 5 December 1st 04 08:02 PM


All times are GMT +1. The time now is 01:23 PM.

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

About Us

"It's about Microsoft Excel"