CountifS + multiple criteria + distinct count
<p>I'm looking for a formula calculating : distinct Count + multiple criteria
Countifs() does it but do not includes distinct count...</p>

<p>Here is an example.</p>

<p>I have a table on which I want to count the number of distinct items (column item) satisfying multiple conditions one column A and B : A>2 and B&lt;5.</p>

<p><a href="https://i.stack.imgur.com/yvwX5.jpg" rel="nofollow noreferrer">Image description here</a></p>

<p><a href="https://i.stack.imgur.com/LLiia.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LLiia.jpg" alt="enter image description here"></a></p>

<pre><code>Line  Item  ColA  ColB
1     QQQ    3     4
2     QQQ    3     3
3     QQQ    5     4
4     TTT    4     4
5     TTT    2     3
6     TTT    0     1
7     XXX    1     2
8     XXX    5     3
9     zzz    1     9
</code></pre>

<p>Countifs works this way : COUNTIFS([ColumnA], criteria A,   [ColumnB], criteria B)</p>

<p>COUNTIFS([ColumnA], > 2 ,   [ColumnB], &lt; 5)</p>

<p>Returns : lines 1,2,4,5,8 => Count = 5</p>

<p><strong>How can I add a distinct count function based on the Item Column ?</strong> :</p>

<p>lines 1,2 are on a unique item QQQ</p>

<p>lines 4,5 are on a unique item TTT</p>

<p>Line 8 is on a unique item XXX</p>

<p>Returns Count = 3</p>

<p>How can I count 3 ?!</p>

<p>Thanks</p>

<p>You can download the excel file @ <a href="https://www.dropbox.com/s/qsl0y8k47v2ssei/stackoverflow.xlsx?dl=0" rel="nofollow noreferrer">Excel file</a></p>