#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
chiapas77
 
Posts: n/a
Default counting


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: http://www.excelforum.com/member.php...o&userid=30568
View this thread: http://www.excelforum.com/showthread...hreadid=518894

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Kevin Vaughn
 
Posts: n/a
Default counting

I 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 Vaughn


"chiapas77" wrote:


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: http://www.excelforum.com/member.php...o&userid=30568
View this thread: http://www.excelforum.com/showthread...hreadid=518894


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ken Johnson
 
Posts: n/a
Default counting

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 Johnson

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Richard Buttrey
 
Posts: n/a
Default counting

On Fri, 3 Mar 2006 15:56:33 -0600, chiapas77
wrote:


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.


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:E1<"")/COUNTIF(A1:E1,A1:E1&""))

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
__
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
chiapas77
 
Posts: n/a
Default counting


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: http://www.excelforum.com/member.php...o&userid=30568
View this thread: http://www.excelforum.com/showthread...hreadid=518894



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
conditional counting with Excel LeicaElmar Excel Worksheet Functions 1 October 17th 05 10:23 PM
Counting rows, then counting values. Michael via OfficeKB.com Excel Discussion (Misc queries) 7 August 4th 05 10:57 PM
Counting names in a column but counting duplicate names once TBoe Excel Discussion (Misc queries) 9 May 11th 05 11:24 PM
Counting... Patrick G Excel Worksheet Functions 3 February 23rd 05 10:05 PM
counting Multiple answers in 1 cell + column help me i have an excel problem Excel Discussion (Misc queries) 0 February 21st 05 08:41 AM


All times are GMT +1. The time now is 02:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"