I literally copied a working formula tool from one workflow to another and now my if statement is malformed.
When I try retyping the expression from scratch I get this far:

then when I add the endif the expression shows as malformed:

Here is the exact same expression working fine in another workflow:

Am i missing somethin?
Thanks