Suppose cell A1 contains a string that includes substrings that are either integers or decimals, the decimals being of a form that would match the regex \d+\.\d+
. For example, the contents of cell A1 might be as follows:
foo 1; bar: 0.5 grue 23 frozz-bozz
What formula could I use in a different cell that would extract and sum those numbers. I.e. a formula such that, if the contents of A1 were as given above, the result would be:
24.5
Best Answer
Google Spreadsheet actually has regex methods. There are 3 methods:
However, because I don't really know how to use regex, I'll show you how I would do it using
SPLIT
. This will work even if the numbers aren't separated by a specific character (i.e. space) as shown in the example:Seems to do the job.