Using the COUNTIF Function with SUBTOTAL to calculate the % of 'Yes' answers

Chippyiow

New Member
Joined
Nov 15, 2018
Messages
2
Currently I have a column of data with Yes, No, N/A (I have converted these to blank cells so they are ignored) as the possible answers. I have been able to calculate the % of 'Yes' answers using the Formula:

=COUNTIF(A2:A103,"Yes")/COUNTA(A2:A103)

I would like the % of 'Yes' responses to update as I filter other columns within the table that I am working on. I understand that the SUBTOTAL function is a method of doing this.

Is there a way to use the SUBTOTAL function can be used with the COUNTIF function to calculate the number of 'Yes' answers within the filtered range of cells?

Any help would be greatly appreciated!
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Hi,

=SUMPRODUCT(0+(A2:A103="Yes"),SUBTOTAL(3,OFFSET(A2,ROW(A2:A103)-MIN(ROW(A2:A103)),)))/SUBTOTAL(3,A2:A103)

Regards
 
Upvote 0

Forum statistics

Threads
1,215,527
Messages
6,125,337
Members
449,218
Latest member
Excel Master

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