0

I have two columns of values. I want to add up the product of the two values, where the 2nd is grater than 1.

Now I'm using a separate 3rd column to aid in this and sumif the values based on the x2 column.

=SUMIF(B1:B9, ">0", C1:C9)
X1 X2 Prod
4 3 12
4 4 16
5 1 5
6 0 0
10 4 40

The result in this case should be 12+16+40 = 68

Is it possible to do the same without the 3rd column?

user692942
  • 16,398
  • 7
  • 76
  • 175
FeaxR
  • 53
  • 1
  • 1
  • 8

3 Answers3

2

Below should work

=SUMPRODUCT((A2:A6)*(B2:B6)*(B2:B6>1))
Harun24hr
  • 30,391
  • 4
  • 21
  • 36
1

Use the FILTER() function, using the 2nd column as the test.

=SUM(FILTER(A1:A5*B1:B5,B1:B5>1))

enter image description here

DS_London
  • 3,644
  • 1
  • 7
  • 24
1

I found another solution that I have somehow missed before

=SUMPRODUCT( --(B1:B9 > 1), A1:A9, B1:B9)
FeaxR
  • 53
  • 1
  • 1
  • 8