Restricting a date variable using month-year on XLS

FYI these things are unambiguously described in the official XPath Specification regarding the precedence order of operators when evaluating XPath expressions. Specifically, from lowest-to-highest precedence:

...
|4 |or                                                      |left-to-right|
|5 |and                                                     |left-to-right|
|6 |eq, ne, lt, le, gt, ge, =, !=, <, <=, >, >=, is, <<, >> |left-to-right|
|7 |to                                                      |left-to-right|
|8 |+, -                                                    |left-to-right|
|9 |*, div, idiv, mod                                       |left-to-right|

Which is to say, AND’s have a higher precedence and are evaluated before ORs (and relational operators before both).

When in doubt, consult the precedence order, or stick a bracket around it :slight_smile:

1 Like