+ Reply to Thread
Results 1 to 3 of 3

count if different

  1. #1
    Registered User
    Join Date
    04-12-2007
    Location
    New York, NY
    Posts
    38

    count if different

    Hi,

    Need to make a quick countif statement.

    I have a column of different countries and need to count the different ones.

    For example, say column j contains:

    Country of Risk
    BRL
    USD
    USD
    EUR
    CAD
    CAD
    ZAR
    BEF
    GBP
    GBP

    i want to count the amount of "different" countries without counting the reoccurring ones twice. So in this example it would return 7 countries rather than 10. An extra bonus would be able to exclude EUR in the same formula since "EURO" is not a country but a currency. Probably a piece of cake to most of you but I cant quite get it.

    Thanks in advance!

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Aren't they all currencies?

    To count different items

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

    or to exclude EUR

    =SUMPRODUCT(((A1:A10<>"")*(A1:A10<>"EUR"))/COUNTIF(A1:A10,A1:A10&""))

  3. #3
    Registered User
    Join Date
    04-12-2007
    Location
    New York, NY
    Posts
    38
    wow, i came back because i forgot to include a detail and you already answered! you guys are so quick. This works perfectly but I need to add one more "IF". The country codes are in column J but i also need to filter out column by account number.

    So if A="account#" then count the number of unique country codes. Im gonna play around with it for a few. Thanks for your help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1