COUNT Question

jcl408

Board Regular
Joined
Jun 3, 2009
Messages
87
Is there a way to do a COUNT of unique items in a column? So if you had a data set with a bunch of entries saying say WIDGETS, GADGETS and GIZMOS, of say 1000 rows alternating between widgets, gadgets and gizmos, is there a formula that would show the count as only 3?
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Is there a way to do a COUNT of unique items in a column? So if you had a data set with a bunch of entries saying say WIDGETS, GADGETS and GIZMOS, of say 1000 rows alternating between widgets, gadgets and gizmos, is there a formula that would show the count as only 3?
Assuming there are no empty cells within the range.

Array entered**:

=SUM(IF(FREQUENCY(MATCH(A1:A1000,A1:A1000,0),ROW(A1:A1000)-ROW(A1)+1),1))

** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER.
 
Upvote 0
=SUM(1/COUNTIF(A1:A1000,A1:A1000))

Confirm with CTRL-SHIFT-ENTER
 
Upvote 0
Was forgetting to SHIFT+CTRL+ENTER.
Yeah, that gets a lot of people.

You can try this normally entered version but it's a bit slow to calculate on a range that size.

Just a normal enter:

=SUMPRODUCT(1/COUNTIF(E2:E2356,E2:E2356))
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,351
Members
452,907
Latest member
Roland Deschain

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