Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count text from the results of a filter

Status
Not open for further replies.

cboz

Technical User
Dec 24, 2002
42
US
In Excel I have autofilterd in column J and I want to count the number of times "M" is in column F. In other words I need something like Countif visible range = M. It's probably easy but I haven't been able to find an example.
 
Hi,

What's your filter criteria on column J?
[tt]
=SUMPRODUCT((J2:J8="X")*(F2:F8="M"))
[/tt]
assuming that your criteria in J were X and your range is rows 2 to 8.

Skip,

[glasses] [red]Be advised:[/red] When you ignite a firecracker in a bowl of vanilla, chocolate & strawberry ice cream, you get...
Neopolitan Blownapart! [tongue]


 
I don't understand the formula but it works. Thanks
 

[tt]
ColF ColJ
X
M
M X
X
M X

X
[/tt]
here's the results of the elements of the formula
[tt]
F2:F8="M" J2:J8="X"
FALSE TRUE
TRUE FALSE
TRUE TRUE
FALSE TRUE
TRUE TRUE
FALSE FALSE
FALSE TRUE
[/tt]
which equates to
[tt]
F2:F8="M" J2:J8="X"
0 1
1 0
1 1
0 1
1 1
0 0
0 1
[/tt]
so when you take the SUMPRODUCT
[tt]
(F2:F8="M")*(J2:J8="X")
=0 0 1
=0 1 0
=1 1 1
=0 0 1
=1 1 1
=0 0 0
=0 0 1
--
2
[/tt]



Skip,

[glasses] [red]Be advised:[/red] When you ignite a firecracker in a bowl of vanilla, chocolate & strawberry ice cream, you get...
Neopolitan Blownapart! [tongue]


 
Eureka! The light bulb is on. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top