Enrico Mendiola
Enrico Mendiola

Reputation: 131

Google Sheets' regular expression calculation

Can I compute the numeral part of a string then put it back in the string using Google Sheets?

0

https://docs.google.com/spreadsheets/d/13zl7uUq8EtbdLDVFrLKfD7XOQ4feqd9Xrm2F4NX6L54/edit

Upvotes: 0

Views: 61

Answers (1)

player0
player0

Reputation: 1

=ARRAYFORMULA(TEXTJOIN(";", 1, 
 IF(REGEXMATCH(TRANSPOSE(SPLIT(C1, ";")), A1), 
 TRANSPOSE(SPLIT(C1, ";"))&" @ $"&A2&" = "&
 REGEXEXTRACT(TRANSPOSE(SPLIT(C1, ";")), "\d+")*A2, 
 IF(REGEXMATCH(TRANSPOSE(SPLIT(C1, ";")), B1), 
 TRANSPOSE(SPLIT(C1, ";"))&" @ $"&B2&" = "&
 REGEXEXTRACT(TRANSPOSE(SPLIT(C1, ";")), "\d+")*B2, ))))

0

Upvotes: 1

Related Questions