I want to write a series of conditional statements (rules?) in Excel for a proof of concept before building a more complex rules engine (in Prolog)
The goal is to be able to apply these statements to different bodies of text, scoring each on depending on how many of the rules are triggered.
I've separated articles so that each word is in its own cell. e.g A1 Word 1, A2, Word 2, A3 Word 3 etc
Example logic statements.
IF "football" resides within 5 words either side of "american" THEN it gets a score of +5
IF "hockey" reside within 5 words of either side of "field" then it gets a score of +10
IF "hockey" reside within 5 words of either side of "ice" then it gets a score of +20
Can this be easily done? Someone has mentioned nested if error vlookups but this is beyond my understanding.
Alternatively, I've explored looking at this in other languages but I can't code plus for the moment other parts of the project work in Excel so I'm kind of tied to it. Those parts do involve macros though so would be open to exploring that option for this.
How would you achieve this in VBA?
Thanks