# SUMPRODUCT/SUBTOTAL Problem

#### howsono

##### New Member
I'm trying to put together a formula to count up how many students get each grade in a filtered list. I discovered the following formula somewhere which seemed to be working, but on the spreadsheet in question both D and D- grades are coming up as 2 whereas there are actually only 1 of each!

=SUMPRODUCT(SUBTOTAL(3,OFFSET(\$W\$2:\$W\$162,ROW(\$W\$2:\$W\$162)-MIN(ROW(\$W\$2:\$W\$162)),,2)),--(\$W\$2:\$W\$162=V181))

I can't pose attachments but can email or dropbox or whatever the file if there is not enough information here? Any help would be appreciated!!!

thanks

### Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

#### NewOrderFac33

##### Well-known Member
Welcome to the Forum!

Don't know if it's of any help, but I had a similar issue with SUMPRODUCT last week where it was reporting inflated count values.

I never got to the bottom of it, but found that using SUMIFS instead resolved the issue and returned the correct values.

Pete

#### howsono

##### New Member
Hi Pete

SUMIFS I think won't work with filtered data though?

thanks

Oli

#### XOR LX

##### Well-known Member
Hi.

Your reference and height parameters for OFFSET were not correct for your set-up.

Try:

=SUMPRODUCT(SUBTOTAL(3,OFFSET(\$W\$2,ROW(\$W\$2:\$W\$162)-MIN(ROW(\$W\$2:\$W\$162)),,,)),--(\$W\$2:\$W\$162=V181))

Regards

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,164,214
Messages
5,836,045
Members
430,402
Latest member
bcurran2

### 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.

### Which adblocker are you using?

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

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