count

L

LatinViolin

there are 3 values in a column. they are 2, 2, 3. what formula or function
do i use to determine how many different values exist in this set. the
answer is 2. there are two different values, 2 & 3. please help
 
J

JulieD

Hi

if your data is only numeric and doesn't contain blanks you can use the
following formula from Chip Pearson's web site
=SUM(N(FREQUENCY(A5:A7,A5:A7)>0))

where A5:A7 is the range of your values.

If you will be dealing with text or your data could have blanks in it -
check out Chip's page on duplicates at:
http://www.cpearson.com/excel/duplicat.htm
- about half way down you'll find an article on counting unique entries in a
range.

Cheers
JulieD
 
J

John Mansfield

The formula below assumes your data is in the range A1:A3. Enter this
formula as an array (select the range A1:A3, put the formula in the formula
bar, and press CTRL - SHIFT - ENTER at the same time):

=SUM(IF(FREQUENCY(A1:A3,A1:A3)>0,1))

This Microsoft Knowledgebse article explains things a little more:

http://support.microsoft.com/kb/q268001/
 
R

RagDyeR

If the column might contain blank cells, try this:

=SUMPRODUCT((A1:A30<>"")/COUNTIF(A1:A30,A1:A30&""))
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


there are 3 values in a column. they are 2, 2, 3. what formula or function
do i use to determine how many different values exist in this set. the
answer is 2. there are two different values, 2 & 3. please help
 
L

LatinViolin

thanks for your answer

JulieD said:
Hi

if your data is only numeric and doesn't contain blanks you can use the
following formula from Chip Pearson's web site
=SUM(N(FREQUENCY(A5:A7,A5:A7)>0))

where A5:A7 is the range of your values.

If you will be dealing with text or your data could have blanks in it -
check out Chip's page on duplicates at:
http://www.cpearson.com/excel/duplicat.htm
- about half way down you'll find an article on counting unique entries in a
range.

Cheers
JulieD
 
L

LatinViolin

RagDyeR said:
If the column might contain blank cells, try this:

=SUMPRODUCT((A1:A30<>"")/COUNTIF(A1:A30,A1:A30&""))
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


there are 3 values in a column. they are 2, 2, 3. what formula or function
do i use to determine how many different values exist in this set. the
answer is 2. there are two different values, 2 & 3. please help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top