ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   COUNTIF Function on filtered data (https://www.excelbanter.com/excel-discussion-misc-queries/191127-countif-function-filtered-data.html)

tg

COUNTIF Function on filtered data
 
I want to be able to filter data (using criteria in Col A) and then count
numbers (in another column) that are greater than or less than a certain
number. I only want to count the numbers from the filtered area, not from
the whole range of data. I want this to be dynamic, so that when I change
filters in Col A it still only counts numbers from the filtered data.

The COUNTIF function counts numbers from the whole range and the SUBTOTAL
function doesn't have a reference number for the COUNTIF function.

Is there a way to do this?

Bob Phillips

COUNTIF Function on filtered data
 
=SUMPRODUCT(SUBTOTAL(3,OFFSET(A1,ROW($A$2:$A$19)-ROW($A$1),,1)),--($C$2:$C$1920)),--($C$2:$C$19<=50))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"TG" wrote in message
...
I want to be able to filter data (using criteria in Col A) and then count
numbers (in another column) that are greater than or less than a certain
number. I only want to count the numbers from the filtered area, not from
the whole range of data. I want this to be dynamic, so that when I change
filters in Col A it still only counts numbers from the filtered data.

The COUNTIF function counts numbers from the whole range and the SUBTOTAL
function doesn't have a reference number for the COUNTIF function.

Is there a way to do this?




tg

COUNTIF Function on filtered data
 
thank you so much Bob - I've been working on this for hours, that's so
amazingly helpful!!!

"Bob Phillips" wrote:

=SUMPRODUCT(SUBTOTAL(3,OFFSET(A1,ROW($A$2:$A$19)-ROW($A$1),,1)),--($C$2:$C$1920)),--($C$2:$C$19<=50))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"TG" wrote in message
...
I want to be able to filter data (using criteria in Col A) and then count
numbers (in another column) that are greater than or less than a certain
number. I only want to count the numbers from the filtered area, not from
the whole range of data. I want this to be dynamic, so that when I change
filters in Col A it still only counts numbers from the filtered data.

The COUNTIF function counts numbers from the whole range and the SUBTOTAL
function doesn't have a reference number for the COUNTIF function.

Is there a way to do this?






All times are GMT +1. The time now is 04:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com