Re: Extract a number from a variable text string

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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" <tipsy@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4716BC87-1B23-4579-A4C8-1F656A7C0A03@xxxxxxxxxxxxxxxx
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" <tipsy@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D23C73A5-4861-453D-80A9-BAEB0BDDC348@xxxxxxxxxxxxxxxx
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.





.



Relevant Pages

  • Re: Problem with SUMPRODUCT
    ... Microsoft Excel MVP ... Your SUMP formula is testing those ranges for NUMBERS. ... If the formula in H extracts the month: ... Is it my formats maybe? ...
    (microsoft.public.excel.misc)
  • Re: regexp truncate line (too long to read)
    ... the range of string that matched all of exp ... grab some numbers to variable mynum ... So we are desperately trying to make "08" to a number "8", what can Tcl do for us poor misguided zero-leading numbers using primates? ... This extracts the ML_nn_NAME from the start of the whole line and then extracts the nn as number from that and then passes out the highest value of nn found. ...
    (comp.lang.tcl)
  • Re: Sum.if date is in an interval...
    ... thanks a lot for invaluable help! ... but that is counting a particular string. ... "Bernard Liengme" wrote: ... Microsoft Excel MVP ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Sum.if date is in an interval...
    ... thanks a lot for invaluable help! ... but that is counting a particular string. ... "Bernard Liengme" wrote: ... Microsoft Excel MVP ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Help Extracting Numbers formula
    ... Microsoft Excel MVP ... The LEFT function returns the specified number of characters of a string ... starting from the leftmost character. ... then in cell A3, I'd like to multiply 3 and 400. ...
    (microsoft.public.excel.misc)