Countif on filtered worksheet

MarkAndrews

Well-known Member
Joined
May 2, 2006
Messages
1,970
Office Version
  1. 2010
Platform
  1. Windows
OK, I am well and truly puzzled with this one

I have a sheet which contains filters, however I need to use a countif based on criteria of the filter & I only want to count the visible names down column A

I was attempting to modify

=countif(subtotal(2,Analysis!A:A),Sheet4!J2)

But this will not work, is there a better method?

TIA
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
What is the criteria for your filter? Can you incorporate this criteria into a SUMPRODUCT formula?
 
Upvote 0
What is the criteria for your filter? Can you incorporate this criteria into a SUMPRODUCT formula?

Column R being filtered to NOC, on sheets tab called "Analysis"

??? :unsure:
 
Upvote 0
Try something like:

=SUMPRODUCT(SUBTOTAL(3,OFFSET(Analysis!A$2:A$10,ROW(Analysis!A$2:A$10)-ROW(Analysis!A$2),0,1)),--(Analysis!A$2:A$10=Sheet4!J2))

Adjust the ranges to suit, but they can't be entire columns.
 
Upvote 0
Hi Guys,

Whilst both formula's work, neither return any count?

Andrew - I changed yours to

=SUMPRODUCT(SUBTOTAL(3,OFFSET(Analysis!A$2:A$1000,ROW(Analysis!A$2:A$1000)-ROW(Analysis!A$2),0,1)),--(Analysis!A$2:A$10=Sheet4!H2))
 
Upvote 0
You have to change all the ranges:

SUMPRODUCT(SUBTOTAL(3,OFFSET(Analysis!A$2:A$1000,ROW(Analysis!A$2:A$1000)-ROW(Analysis!A$2),0,1)),--(Analysis!A$2:A$1000=Sheet4!H2))
 
Upvote 0
You have to change all the ranges:

SUMPRODUCT(SUBTOTAL(3,OFFSET(Analysis!A$2:A$1000,ROW(Analysis!A$2:A$1000)-ROW(Analysis!A$2),0,1)),--(Analysis!A$2:A$1000=Sheet4!H2))

Again, it works, but does not return anything other than 0
:unsure: :unsure:
 
Upvote 0
So what's in Sheet4!H2, and does that exist in Analysis!A2:A1000?

I’ve cheated

I took a PSV of the filtered sheet, into a xlveryhidden sheet, then bounced the countif off that using a button

Thanks for the ideas however
 
Upvote 0

Forum statistics

Threads
1,213,543
Messages
6,114,236
Members
448,555
Latest member
RobertJones1986

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