Counting without double counting

G

Guest

Guest
I have a list of numbers. Some numbers are the same. I want to count how many numbers are in the list. But I don't want to count the same number more than once.

For instance: 1, 67, 4, 32, 4, 3
Should count: 5
The four only gets counted once.

Any help would be greatly appreciated.
Thanks
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
On 2002-03-15 06:56, Anonymous wrote:
I have a list of numbers. Some numbers are the same. I want to count how many numbers are in the list. But I don't want to count the same number more than once.

For instance: 1, 67, 4, 32, 4, 3
Should count: 5
The four only gets counted once.

Any help would be greatly appreciated.
Thanks

=IF(LEN(A1:A10),SUMPRODUCT(1/COUNTIF(A1:A10,A1:A10)))

where A1:A10 houses the target numbers.
 
Upvote 0
1. If you want to specify the specific range
for the data (revise to fit your info)

=SUMPRODUCT(1/COUNTIF(A1:A6,A1:A6))

2. If you want to specify a range
that may include blank cells, use
Array formulas such as the following:

a) =SUM(IF(LEN(rData),1/COUNTIF(rData,rData)))

b) =SUM(IF(LEN(A1:A100),1/COUNTIF(A1:A100,A1:A100)))

Enter the Array formulas with Ctrl-Shift-Enter (CSE)
 
Upvote 0
On 2002-03-15 06:56, Anonymous wrote:
I have a list of numbers. Some numbers are the same. I want to count how many numbers are in the list. But I don't want to count the same number more than once.

For instance: 1, 67, 4, 32, 4, 3
Should count: 5
The four only gets counted once.

Any help would be greatly appreciated.
Thanks

With your values in A1:A6 use...

=COUNT(IF(FREQUENCY(A1:A6,A1:A6),1))
 
Upvote 0

Forum statistics

Threads
1,214,403
Messages
6,119,309
Members
448,886
Latest member
GBCTeacher

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top