vendredi 21 août 2020

Regexmatch for multiple words in Sheets

I'm trying to write a REGEXMATCH formula for Sheets that will analyze all of the text in a cell and then write a given keyword into another cell.

I've figured out how to do this for a single keyword: for example,

=IF(REGEXMATCH(F3, "czech"),"CZ",IF(REGEXMATCH(F3, "african"),"AF",IF(REGEXMATCH(F3, "mykonos"),"MK")))

What I'm having trouble with though is writing one of these values only if two or more terms are matched in the reference cell.

If I were trying to match one of two words, I realize I could use | as in:

=IF(REGEXMATCH(F3, "czech|coin"),"CZC"

etc

But in this instance I only want to produce CZC if the previous cell contains BOTH czech AND coin.

Can someone help me with this?

Aucun commentaire:

Enregistrer un commentaire