Home > front end >  Excel/Sheets - extract only next word after character
Excel/Sheets - extract only next word after character

Time:12-01

I am trying to extract the colour (Farve) from this text string. I can't seem to make the extraction either stop, or start the right place. Also, the length of the target extraction will vary, as colours of course are varying length name. The picture is of the target texted, wanted in the cell.

Hope some might be able to help, thank you. enter image description here

I have tried multiple solutions of Len, left, right combination as well as trim, index combination and regexetraxt.

CodePudding user response:

If you have Excel 365 current channel, you can use this formula:

=LET(splitData,TEXTSPLIT(A2,":",CHAR(10)),
CHOOSECOLS(FILTER(splitData,CHOOSECOLS(splitData,1)="Farve"),2))

It first splits the data by colon and linebreak - this will return a two-column matrix. This matrix can be filtered by the first column to be "Farve" ...

CodePudding user response:

target it like:

=REGEXEXTRACT(A2; "(?i)Farve: (. )")

enter image description here

  • Related