Yes. Your criteria text needs to be bookmarked. An easy way to do this is to put it in a legacy protected form field and protect your documents for forms. If you do that and mark the option in the field to "calculate on exit" you can use an IF field to do your test and display your results.
It is not as easy as in Excel, but can be done.
IF fields
Making Forms with Microsoft Word