I need help in getting excel to count the number of different number
values in a specified range of cells across a row. example:
1 1 2 should return 2
0 1 2 should return 3
2 2 2 should return 0
Can anyone help? thanks.--
chiapas77
------------------------------------------------------------------------
chiapas77's Profile: www.excelforum.com/member.php...oamp;userid=30568
View this thread: www.excelforum.com/showthread...hreadid=518894I took an array formula that I've seen used for getting unique numbers and
made a slight change to it so that if there was only one unique item, it
would return 0. Worked on your test data.
=IF(SUM(1/COUNTIF(A2:C2,A2:C2))=1,0,SUM(1/COUNTIF(A2:C2,A2:C2)))
Enter with cntl-shift-enter, not just enter.
--
Kevin Vaughnquot;chiapas77quot; wrote:
gt;
gt; I need help in getting excel to count the number of different number
gt; values in a specified range of cells across a row. example:
gt; 1 1 2 should return 2
gt; 0 1 2 should return 3
gt; 2 2 2 should return 0
gt;
gt; Can anyone help? thanks.
gt;
gt;
gt; --
gt; chiapas77
gt; ------------------------------------------------------------------------
gt; chiapas77's Profile: www.excelforum.com/member.php...oamp;userid=30568
gt; View this thread: www.excelforum.com/showthread...hreadid=518894
gt;
gt;
Hi chiapas,
Please don't ask the same question on more than one forum.
People working on your problem are wasting their time if you have
already got the answer from another forum. Some of these people find
that very annoying.
Ken JohnsonOn Fri, 3 Mar 2006 15:56:33 -0600, chiapas77
gt; wrote:
gt;
gt;I need help in getting excel to count the number of different number
gt;values in a specified range of cells across a row. example:
gt;1 1 2 should return 2
gt;0 1 2 should return 3
gt;2 2 2 should return 0
gt;
gt;Can anyone help? thanks.
I don't quite understand why 2,2,2 should return 0. Logic suggests it
should perhaps be 1
From a suggestion by Bob Philips several months ago.
=SUMPRODUCT((A1:E1lt;gt;quot;quot;)/COUNTIF(A1:E1,A1:E1amp;quot;quot;))
Just change the A:E range to cover the number of columns in your rows.
If you really want a 2,2,2 type row to show 0 rather than 1 then you
probably need to wrap it all in an If(Fn=1,0,Fn) construction.
HTH
Richard Buttrey
__
I apologize for the double post... Thanks Kevin and Richard for your
help... actually you are right Richard... 2,2,2 would return 1 and it's
ok. This help really got me out of a jam.
saul.--
chiapas77
------------------------------------------------------------------------
chiapas77's Profile: www.excelforum.com/member.php...oamp;userid=30568
View this thread: www.excelforum.com/showthread...hreadid=518894
- Apr 21 Sat 2007 20:36
counting
close
全站熱搜
留言列表
發表留言