Sumif problem

rjmat

New Member
Joined
Dec 17, 2004
Messages
23
Hello,
I am puzzled and cannot figure out what the problem is. It is a simple sumproduct formula (I use pretty frequent). In this case, it is not producing the right result.

I have 8,000 rows of data. I used a subtotal function on the top in row 1. The filter is active with headings on row 2. So far so good. Now, when I filter (AJ) a column to show only 0 (zero), another column (=SUBTOTAL(9,AC3:AC7804)) reflects a value (171). Now, I want to use a sumproduct formula (=SUMPRODUCT(--(AJ3:AJ7804=0)*(AC3:AC7804))) to produce the same result with the use of a filter. It came back with another value (225). I have no idea why? It should be showing 171.

Any help is appreciated :)
RJMAT
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Its because the second array multiplies with the result and gives you the sum of it. i.e. Have a quick look at formula evaluation toolbar on small sample of say 5, 10 values. If you are interested in getting the count then you should use either:
=SUMPRODUCT(--(AJ3:AJ7804=0))
OR
=COUNTIF(AJ3:AJ7804,0)
 
Upvote 0
taurean - thanks for your efforts, however, it only functioned like a count. Not exactly what I was looking for.

Andrew Poulsom - thank you very much, that did the trick! It is amazing how this formula works with the addition of subtotal function.

Have a great day to both of you! :)
 
Upvote 0
I misunderstood your requirement and then learned something on the way.
 
Upvote 0

Forum statistics

Threads
1,224,502
Messages
6,179,126
Members
452,890
Latest member
Nikhil Ramesh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top