Home > Software design >  Getting value between '-' in google sheets
Getting value between '-' in google sheets

Time:08-24

Im trying to get the number between '-' and '-' in google sheets but after trying many things I still havent been able to find the solution.

Data record 1
England Premier League
West Ham vs Crystal Palace
2.090 - 3.47 - 3.770

Expected value = 3.47

Data record 2
England League Two
Carlisle vs Scunthorpe
2.830 - 3.15 - 2.820

Expected value = 3.15

Hopefully someone can help me out

CodePudding user response:

Try either of the following

option 1.

=INDEX(IFERROR(REGEXEXTRACT(AE1:AE4," \d \.\d  ")*1))

option 2.

=INDEX(IFERROR(REGEXEXTRACT(AE1:AE4,".* - (\d \.\d ) ")))

(Do adjust the formula according to your ranges and locale)

enter image description here

CodePudding user response:

use:

=INDEX(IFNA(REGEXEXTRACT(A1:A, "- (\d (?:.\d )?) -")*1))

enter image description here

  • Related