Home > Blockchain >  Extract any string after colon in Google sheet cell with multiple lines
Extract any string after colon in Google sheet cell with multiple lines

Time:12-13

I am trying to extract everything after a colon : in a cell that has multiple lines within one cell.


Any text: John

Any text: Peter

Any text: Paul

Expected result


John

Peter

Paul

Any help, would be appreciated.

Tried

=REGEXEXTRACT(A1,".*:(.*)")

But only returning first line

CodePudding user response:

use:

=ARRAYFORMULA(IFERROR(BYROW(SPLIT(A:A,char(10)),LAMBDA(ax,JOIN(CHAR(10),REGEXEXTRACT(ax,":\s?(.*)$"))))))

enter image description here

CodePudding user response:

You can use this:

=INDEX(REGEXEXTRACT(split(A1,CHAR(10)),". : (. )"))

Or, if you want it vertically, add TRANSPOSE:

=TRANSPOSE(INDEX(REGEXEXTRACT(split(A1,CHAR(10)),". : (. )")))
  • Related