excel - Summing rows condition on two columns -
i'd use array function conditional sum based on 2 columns. given example, each id want calculate sum of value column if column b -1
.
id | b | value | ________________________ 1 a1 1 2 2 a2 1 3 3 a3 1 4 4 a3 -1 5 5 a3 -1 1 6 a2 1 5 7 a1 1 1 8 a2 -1 2
the outcome should be:
id | value_total | ________________________ 1 a1 1 0 2 a2 1 2 3 a3 1 6
this gives outcome show example data:
edit seems have ‘done trick’, explanation:
=sumifs syntax
sumifs(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)
so in case formula summing columnd values in corresponding row columnb value whatever happens in columnb row containing formula , columnc value -1
.
the answer not repeat column unique values of id because 3 distinct ids shown in example and, conveniently, these first 3 , in order.
Comments
Post a Comment