Counting the number of different values in a list

Saloomi

New Member
Joined
Apr 8, 2002
Messages
10
Here's the problem:
I have a long list of countries, many of which occur several times. I want a formula which will determine how many DIFFERENT coutries there are in the list.

E.g:

China
Denmark
Denmark
Finland

Total = 3

It feels like it should be simple - but I can't do it! Thanks in advance...
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
ok. this is a long away..
just incase it is urgent..its all i know off my head.

select your fiels. then go to data/filter/advanced filter.. and filter by unique fields.
then copy these fields to a new column and see how many rows there are.
 
Upvote 0
On 2002-04-09 00:18, Saloomi wrote:
Here's the problem:
I have a long list of countries, many of which occur several times. I want a formula which will determine how many DIFFERENT coutries there are in the list.

E.g:

China
Denmark
Denmark
Finland

Total = 3

It feels like it should be simple - but I can't do it! Thanks in advance...

Array-enter:

=SUM(IF(LEN(A2:A5),1/COUNTIF(A2:A5,A2:A5)))

where A2:A5 houses the country data.

In order to array-enter a formula you need to hit control+shift+enter, not just enter.
 
Upvote 0

Forum statistics

Threads
1,213,531
Messages
6,114,167
Members
448,554
Latest member
Gleisner2

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