You may be interested in this UDF. It can be used in spreadsheet formulas.
getFirstNumber returns the number matching the first numeral in a string
getFirstNumber("xx12yy") =12
getfirstnumber("xx1.2yy33")=1.2
Be aware of "-" and "."
getfirstNumber("xx. 3")=.3
getFirstNumber("aa-34")=-34
If the optional second argument (percentCorrection) is set to True, it checks for a "%" anywhere after the first numeral and returns the decimal expression. percentCorretion defaults to False.
getFirstNumber("aa30%") = 30
getFirstNumber("aa30%", False) = 30
getFirstNumber("aa30%", True) = .3
getFirstNumber("bb24xyz12%x",True) = .24
I hope it helps.
Bookmarks