# Insert range using the IF formula in the SUM function with multiple criteria (using a matrix formula)

I am using arrayformula with my sumif function that has several criteria and ranges to automatically expand through an established column (B). The following formula works perfectly: = ARRAYFORMULA (SUMIF (& # 39; DATA & # 39 ;! \$ N: \$ N & & # 39; DATA & # 39 ;! \$ U: \$ U & & # 39; DATA & # 39 ;! \$ V: \$ V & & # 39; SFDC DATA & # 39 ;! \$ BV: \$ BV, \$ B \$ 6: \$ B & \$ E \$ 30 and \$ D \$ 26 and \$ C \$ 36, & # 39; DATA & # 39; \$ AG: \$ AG).

I want to make it more dynamic and insert an "IF" statement to really refer to one rank versus another based on certain conditions. For example, IF (\$ A \$ 6: \$ A = XX, & # 39; DATA & # 39;! \$ N: \$ N, & # 39; DATA & # 39;! \$ M: \$ M).

The formula is broken if I do this = ARRAYFORMULA (SUMIF (IF (\$ A \$ 6: \$ A = XX, & # 39; DATA & # 39;! \$ N: \$ N, & # 39; DATA & # 39;! \$ M : \$ M) & & # 39; DATA & # 39;! \$ U: \$ U and & # 39; DATA & # 39 ;! \$ V: \$ V and & # 39; SFDC DATA & # 39;! \$ BV: \$ BV , \$ B \$ 6: \$ B and \$ E \$ 30 and \$ D \$ 26 and \$ C \$ 36, & # 39; DATA & # 39;! \$ AG: \$ AG).

Any way / solution to make it work? I tried several times, I read several forums but I can't find an answer.

Thank you,

Max