Home > database >  How to use Regextract function to get all text before a certain value in Google sheet?
How to use Regextract function to get all text before a certain value in Google sheet?

Time:12-08

I would like to get the value before this text 01 January 2020_Oncall_Endorsement

So I want to get all text before"_Oncall_Endorsement" the result should be "01 January 2020"

CodePudding user response:

Use REGEXEXTRACT with a capture group:

=REGEXEXTRACT("01 January 2020_Oncall_Endorsement", "(.*?)_Oncall_Endorsement")

CodePudding user response:

try:

=REGEXEXTRACT(A1; "\d  .* \d{4}")
  • Related