I realize the solution I’m looking for can easily be accomplished by adding
additional columns for words and conditionally check for them, but I am hoping
to do some basic string parsing instead to minimize the number of columns that
I would not otherwise need in all other contexts.
- How to parse string based on simple “language”?
If A1 has the value “a past 6m”, add 6 months to the date in B1 and return that
date in D1; if A1 has the value “b past 12m” add 12 months to the date in C1
and return that date in D1. That’s all for the language: interpret whether the
first word is “a” or “b” and the last word to be the number of months to add.
The sentence could also be “a past 6” instead of “a past 6m” but I’d rather
have the given context of “6 months” than it being implied the # of months.
- How to check that A1 contains a certain string A AND B2 contains word B and word C, but not word D? E.g.:
A1 has the value “teacher” and B1 has the value “math science”. C1 should check that
A1 is “teacher” and B1 has the words “math” and “science” but not “history”, so
returns true in this case. If B1 was e.g. instead “math history science” or
“math”, return false.
Much appreciated.