Add "SUBTOTAL 3" to a "SUMPRODUCT" formula

rjdickson

New Member
Joined
Jul 27, 2011
Messages
2
Hello - newby here

Was reading the forum as a guest in relation to a query I had in relation to the use of COUNTIF when filtering. I am pleased to report I solved it with the help of a 4-year old post, which introuced me to SUMPRODUCT. :)

In solving my initial query, it threw up another... This again was to do with filter results.

The original query was in regards to how to count a number of cells that contained "DL", but I also wanted to filter the data is it is going to be analyised in months. The resolution looks as follows:

=SUMPRODUCT(SUBTOTAL(3,OFFSET(G2,ROW($G$3:$G31)-ROW($G$2),,1)),--($G$3:$G31="DL"))


I then created a forumla that counts the number of Pass cells for DL, which looks as follows:

=SUMPRODUCT((G3:G31="DL")*(H3:H31="Pass"))

My issue is that when I filter out the data, the results of my new formila don't change to reflect the data that is shown. I need to add a "SUBTOTAL" to the formula, similar to my first, but I am stumped as to how.

Any thoughts?
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Hello rjdickson, welcome to MrExcel

Try this version

=SUMPRODUCT(SUBTOTAL(3,OFFSET(G3,ROW(G3:G31)-ROW(G3),0)),(G3:G31="DL")*(H3:H31="Pass"))
 
Upvote 0
Worked a treat - most appreciated! :)

Certainly will be using this site for anything I get stuck on again in the future!
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,280
Members
452,902
Latest member
Knuddeluff

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