close
Can anybody explain me logic behind this formula
=SUMPRODUCT((A1:A4lt;gt;quot;quot;)/COUNTIF(A1:A4,A1:A4amp;quot;quot;))
This formula will use to count the items (it will ignore the repeated items)
Please help me .

Hi Vishu,

=SUMPRODUCT((A1:A10lt;gt;quot;quot;)/COUNTIF(A1:A10,A1:A10amp;quot;quot;))
will calculate the number of unique items.

How?
Say your range A1:A10 contains the values:
1,2,3,1,2,2,4,quot;quot;,quot;quot;,quot;quot;
The first part of the formula (A1:A10lt;gt;quot;quot;) returns and array of TRUE or
FALSE depending on whether the cell contains an entry.
TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,FALSE,FALSE,FAL SE
The second part COUNTIF(A1:A10,A1:A10amp;quot;quot;) uses one of the more unusual ways
of using COUNTIF. Again it returns an array but this time each value in the
array represents a count of the numbers in the array using each value of the
array as a criteria.
2,3,1,2,3,3,1,3,3,3
That is, there are two values of 1, three of 2, one of 3 and three of blank.
The TRUE and FALSE array is divided by the count array:
0.5,0.33,1,0.5,0.33,0.33,1,0.33,0.33,0.33
The final three values are ignored (because of the FALSE) leaving
0.5,0.33,1,0.5,0.33,0.33,1
Add this array together and the result is 4.

sought from - bygsoftware.com
--
Regards,
vijayquot;vishuquot; wrote:

gt; Can anybody explain me logic behind this formula
gt; =SUMPRODUCT((A1:A4lt;gt;quot;quot;)/COUNTIF(A1:A4,A1:A4amp;quot;quot;))
gt; This formula will use to count the items (it will ignore the repeated items)
gt; Please help me .

Hi Vijay,
Thanks for your help.
Can you please tell me if Cells A1:A10 has text charcters.(non numerics)
How this formula works

regards
vishu

quot;vijayquot; wrote:

gt; Hi Vishu,
gt;
gt; =SUMPRODUCT((A1:A10lt;gt;quot;quot;)/COUNTIF(A1:A10,A1:A10amp;quot;quot;))
gt; will calculate the number of unique items.
gt;
gt; How?
gt; Say your range A1:A10 contains the values:
gt; 1,2,3,1,2,2,4,quot;quot;,quot;quot;,quot;quot;
gt; The first part of the formula (A1:A10lt;gt;quot;quot;) returns and array of TRUE or
gt; FALSE depending on whether the cell contains an entry.
gt; TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,FALSE,FALSE,FAL SE
gt; The second part COUNTIF(A1:A10,A1:A10amp;quot;quot;) uses one of the more unusual ways
gt; of using COUNTIF. Again it returns an array but this time each value in the
gt; array represents a count of the numbers in the array using each value of the
gt; array as a criteria.
gt; 2,3,1,2,3,3,1,3,3,3
gt; That is, there are two values of 1, three of 2, one of 3 and three of blank.
gt; The TRUE and FALSE array is divided by the count array:
gt; 0.5,0.33,1,0.5,0.33,0.33,1,0.33,0.33,0.33
gt; The final three values are ignored (because of the FALSE) leaving
gt; 0.5,0.33,1,0.5,0.33,0.33,1
gt; Add this array together and the result is 4.
gt;
gt; sought from - bygsoftware.com
gt; --
gt; Regards,
gt; vijay
gt;
gt;
gt; quot;vishuquot; wrote:
gt;
gt; gt; Can anybody explain me logic behind this formula
gt; gt; =SUMPRODUCT((A1:A4lt;gt;quot;quot;)/COUNTIF(A1:A4,A1:A4amp;quot;quot;))
gt; gt; This formula will use to count the items (it will ignore the repeated items)
gt; gt; Please help me .


Hi Vishu,

Text works the same as numbers. When you see the arrays it should be
clearer. Follow these steps:

1. Enter the data suggested by Vijay into cells A1 to A10.

2. Enter the first array formula into an array between B1 and B10 by
highlighting B1 to B10, type =A1:A10lt;gt;quot;quot; and whilst holding the Ctrl
amp; Alt keys, press Enter. You'll notice the braces around the outside
of the formula entered.

3. Enter the array formula =COUNTIF(A1:A10,A1:A10amp;quot;quot;) into the cells
C1 to C10 using the same method.

4. Enter the normal worksheet formula =B1/C1 into cell D1 and copy
down to cells D2 to D10.

5. Enter a total in D11 to see the final result of the formula

6. You can then place other data (including repeated text) into cells
A1 to A10 and observe the effect of the changes.--
John James
------------------------------------------------------------------------
John James's Profile: www.excelforum.com/member.php...oamp;userid=32690
View this thread: www.excelforum.com/showthread...hreadid=526418
arrow
arrow
    全站熱搜

    software 發表在 痞客邦 留言(0) 人氣()