# Count Distinct Values With A Criteria In A Filtered List

1. ## Count Distinct Values With A Criteria In A Filtered List

I'm wondering if it is possible to do a count for distinct values that meet a certain criteria on a list that has filters applied to it (only use visible).

I found an array formula to calculate distinct values:
Formula:
`Please Login or Register  to view this content.`

Real example:
Formula:
`Please Login or Register  to view this content.`

I also found a different array formula that counts only visible cells in a list:
Formula:
`Please Login or Register  to view this content.`

I'm looking for a way to combine these such that I get the functionality of the second formula with the [criteria] piece of the first formula. Anybody know if this is possible?

Example use case:
Use Case.png

2. ## Re: Count Distinct Values With A Criteria In A Filtered List

Yes, it can be done. see sheet:

=SUM(IF(FREQUENCY(IF(SUBTOTAL(3,OFFSET(\$A\$2,ROW(\$A\$2:\$A\$13)-MIN(ROW(\$A\$2:\$A\$13)),)),IF(LEFT(\$B\$2:\$B\$13,1)=F15,MATCH(\$A\$2:\$A\$13,\$A\$2:\$A\$13,0))),ROW(\$A\$2:\$A\$13)-MIN(ROW(\$A\$2:\$A\$13))+1),1))

It is an array formula. Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

Don't type the curly brackets yourself - it won't work...

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1