'Extract prices from string
I did a google form of items I'm selling, and the form is linked to a google sheet. I want to extract the prices and add them in a separate column.
In the entries I have the price and name of the item, but I want to add only the prices in the next column.
I was using:
=VALUE(RIGHT($D2, 4))
but that will only extract the price when there is one item.
Any information will be helpful!
Solution 1:[1]
SUM() doesn't care about text so you should be able to do:
=SUM(SPLIT(D2," ,$"))
Solution 2:[2]
Try
=sum(split(join("|",REGEXEXTRACT(substitute(A1,"$",""),REGEXREPLACE(substitute(A1,"$",""),"(\d+.\d+)","($1)"))),"|"))
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | MattKing |
| Solution 2 | Mike Steelson |

