Issue merging a SUMIFS using index Match into an arrayformula

43 Views Asked by At

I am having an issue merging two formulas that, independently work.

Formula 1: =ARRAYFORMULA(IFERROR( IF(VLOOKUP($A$2:$A&$B$2:$B, {PLANNER!$D:$D&PLANNER!$G:$G, PLANNER!$S:$S}, 2, FALSE) = "Y", "Adgroup","Campaign"),"error"))

This formula is the basis that should allow me to use a Formula 3 if it returns "Ad group", or my formula 2 if it returns "Campaign"

Formula2: =SUMIFS(DATA!H:H,DATA!B:B, INDEX(REFERENCES!C:C,MATCH(B2&" "&D2, REFERENCES!A:A&" "&REFERENCES!B:B, 0)),DATA!D:D, E2)

This formula sums the impressions generated by my campaigns. The index match allows me to identify the right "platform" the campaigns delivered on.

For the life of me, I can't figure out what I am doing wrong when merging those 2 formulas together. Even replacing the the INDEX match with a VLOOKUP does not work. When merged, the formula returns 0 everywehre. =ARRAYFORMULA(IFERROR( IF(VLOOKUP($A$2:$A&$B$2:$B, {PLANNER!$D:$D&PLANNER!$G:$G, PLANNER!$S:$S}, 2, FALSE) = "Y", "Adgroup",SUMIFS(DATA!$H:$H,DATA!$B:$B, VLOOKUP(CHECK!B2:B&" "&CHECK!D2:D, {REFERENCES!A$2:A&" "&REFERENCES!B$2:B, REFERENCES!C$2:C}, 2, FALSE),DATA!$D:$D, $E2:E)),"error")) --> Returns 0 everywhere

=ARRAYFORMULA(IFERROR( IF(VLOOKUP($A$2:$A&$B$2:$B, {PLANNER!$D:$D&PLANNER!$G:$G, PLANNER!$S:$S}, 2, FALSE) = "Y", "Adgroup",SUMIFS(DATA!$H:$H,DATA!$B:$B, INDEX(REFERENCES!$C:$C,MATCH($B2:B&" "&$D2:D, REFERENCES!$A:$A&" "&REFERENCES!$B:$B, 0)),DATA!$D:$D, $E2:E)),"error")) --> Returns 0 everywhere.

0

There are 0 best solutions below