We have a spreadsheet we are using where personnel input text values in one column, within these text values are certain words we want to hunt for.
If they appear, we want to populate another column with another word. E.g.:
Col1: 'today i went to the beach'
function finds 'beach'
function enters 'sand' in same row of Col5.
Any help greatly appreciated.
Here's a simple approach. It doesn't deal with a cell containing multiple terms or with a term being embedded in another word. eg. If a term were
see
thenseething
would also match.To get fancier and do things like only find complete words, use
match()
and regular expressions, instead ofindexOf()
.