I am trying to find a formula I can use that sums up the numbers in columns F and G provided that value in column A is ... "A", for example
I attempted to be explicit about it by saying =SUMIF(F8:G11,A8:A11="A")
) Sum up stuff in F-G column A has a value of "A"
This doesn't work. What am I missing please?
CodePudding user response:
One the order of SUMIF is: SUMIF(range, criteria, [sum_range])
Two. The sum_range must be the same shape as the range.
We can add two together:
=SUMIF(A8:A11,"A",F8:F11) SUMIF(A8:A11,"A",G8:G11)
Or if you are okay with a little volatility we can use OFFSET and wrap in sumproduct:
=SUMPRODUCT(SUMIF(A8:A11,"A",OFFSET(F8:F11,,{0,1})))
CodePudding user response:
Try:
Formula in B7
:
=SUM(FILTER(F1:G4,A1:A4="A"))
Or;
=SUM((A1:A4="A")*(F1:G4))
I guess the latter can be used with SUMPRODUCT()
in older version.