https://wiki.dinaz.net/if-function-nested-formulas-and-avoiding-pitfalls/