flatten the rest of SUM formulas