Multiple IF statements using '&', how to re-write?


I have this formula, and it works (!) for two checkbox fields; it deals with and/or combinations of ticked/unticked states.

IF({First field}=1, IF({Second field}=1, “Do this and that”, BLANK()))
&IF({First field}=0, IF({Second field}=1, “Do this”, BLANK()))
&IF({First field}=1, IF({Second field}=0, “Do that”, BLANK()))

I’ve been reading around here, and thanks to the help of other community members here for getting me this far in answer to other peoples’ queries.

Out of interest, how could it be re-written to perform the same function without using the ‘&’ operator. I’d love to learn more about formula writing and structures.



CONCATENATE(IF(OR({First field},  {Second field}), "Do "), IF({First field}, "this"), IF(AND({First field},  {Second field}), " and "), IF({Second field}, "that"))

Note the CONCATENATE function does nothing but replace a bunch of & signs; functionally, both ways are equivalent. The more significant difference between my version and yours is the lack of repetition (every variant is stringed together from building blocks that occur only once, instead of repeating the target string common parts) and the shorthand (checking for true does not need to expressly compare to 1, IF does not need to include an else block).

To me, this is the cleaner way to do this, but I am a moderately well versed in programming; your mileage my vary depending on your technical background.


It works very nicely, thank you Martin