Google Sheets – How to Extract Name from Multiline Mangled Text String

google sheets

I am using importhtml() to read data from a website and end up with a value like this in cell A1:

1
JorgeJ SolerSoler
DH
1

How do I extract the name "Jorge Soler" from this data?

Best Answer

Use a formula like this:

=regexextract(A1, "[A-Z][a-z]+") & regexextract(A1, "( [A-Z][a-z]+)[^ ]*?$")

To learn the exact regular expression syntax used by Google Sheets, see RE2. These sites may also help: