excel - Sum row based on criteria across multiple columns -
i have googled hours, not being able find solution need/want. have excel sheet want sum values in 1 column based on criteria either 1 of 2 columns should have specific value in it. instance
b c 1 4 20 7 2 5 100 3 3 100 21 4 4 15 21 4 5 21 24 8
i want sum values in c given @ least 1 of , b contains value of less or equal 20. let assume a1:a5 named a, b1:b5 named b, , c1:c5 named c (for simplicity). have tried:
={sumproduct(c,((a<=20)+(c<=20)))}
which gives me rows both columns match summed twice, and
={sumproduct(c,((a<=20)*(c<=20)))}
which gives me rows both columns match
so far, have settled solution of adding column d lowest value of , b, bugs me can't formulas.
any highly appreciated, in advance. have found when googling "multiple criteria same column" problem.
your problem "summing twice" in formula
={sumproduct(c,((a<=20)+(c<=20)))}
is due addition turning first true plus second true 2. not summing twice, because row, if 1 condition met, count row once.
the solution transform either 1 or 2 1, using if:
={sumproduct(c,if((a<=20)+(c<=20))>0, 1, 0)}
that way, each value in column c counted @ max once.
Comments
Post a Comment