0

Ive got the below string in a Google drive spreadsheet in cell D1, what im trying to do is strip out the low the high and the average into cells F1,G1,H1

Currently, we can provide valuations on 3, across a range of prices: from £4,694,700 to £8,091,700 - Average price £6,624,100

At the moment im using =RIGHT(D1, 11) in cell H1 to get the average £6,624,100 number, but im not sure of the best way to get the others, or how to deal with hundreds of thousands, or tens of millions

Is there a more versatile way this could be done ?

Ive made a dummy spreadsheet here : https://docs.google.com/spreadsheets/d/1r_RbMjI-7KLNt8QMyQzn0d-AN1CsOxbVfjYXyoIXXFU/edit?usp=sharing


Ive marked this as an excel question as ive found 99% of the functions that you can use in Excel you can use in Google Spreadsheets (Google spreadsheets cant use excel macros though..)

0

3 Answers 3

4

Sot the three formulas

1st number

=mid(D1,FIND("£",D1,1),find(" ",D1,FIND("£",D1,1))-FIND("£",D1,1))

2nd number

=mid(D1,FIND("£",D1,FIND("£",D1,1)+2),find(" ",D1,FIND("£",D1,FIND("£",D1,1)+2)+2)-FIND("£",D1,FIND("£",D1,1)+2))

3rd Number

=mid(D1,FIND("£",D1,FIND("£",D1,FIND("£",D1,1)+2)+2),999)
Sign up to request clarification or add additional context in comments.

5 Comments

Agree that this is likely the best method, assuming that each amount is always preceded by a pound sign and that no other pound signs are present.
Thanks ! - Ive added your formulas into the google spreadsheet and locked it as view only
Note that an alternate version of finding each letter would be to use FIND("}}}",SUBSTITUTE(D1,"$","}}}",x)), where x equals the number you're looking for. With 3 searches in this method, I think I still prefer Scott's, but if you had multiple #'s, it would be simpler to use the SUBSTITUTE method.
Also see my alternative solution using REGEXEXTRACT.
@sam give my formula a shot, does this simplify it at all?
2

Alternatively, in cell E2, try:

=ArrayFormula(regexextract(D2:D4, {"£([0-9,]*)\s", "to £([0-9,]*)\s", "£([0-9,]*)$"} )+0)

and format columns E:G as valuta.

You may want to try this on a duplicate sheet because since this is an arrayformula no values or other formulas should be present in E2:G

1 Comment

Google Spreadsheets has a REGEX function that we have been pestering MSFT to introduce for many years? Remarkable.
1

You can use multiple parenthesis to extract separate capture groups, and google sheets automatically splits them into separate cells.

try this:

=REGEXEXTRACT(D1,"(£.*) to (£.*) - Average price (£.*)")

1 Comment

big time ive moved the accepeted answer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.