All of the "condition" parts need to be together in the first part of the IF statement. It would be simpler to make separate columns for each site, and then add them together in a stat, but if you want to do it all in one then you'll need to nest your IFs for each site, like this: sum( if[...