+ Reply to Thread
Results 1 to 3 of 3

Countif <>

  1. #1
    Forum Contributor
    Join Date
    02-10-2007
    MS-Off Ver
    Excel 2010
    Posts
    293

    Countif <>

    Hello,

    I am trying to count Non U.S.

    The formula I have in cell c2, COUNTIF(A:A,"<>"&"United States") is giving wrong number. It should be 3.

    Please see attached file.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Countif <>

    hi VegasL, your current COUNTIF is counting the blanks as non US too. so maybe:
    =COUNTIFS(A:A,"<>"&"United States",A:A,"<>")-1

    the minus 1 is for the header. or can you just put it in a smaller range? this is if you are using 2003 & below:
    =SUMPRODUCT((A2:A100<>"United States")*(A2:A100<>""))

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Contributor
    Join Date
    02-10-2007
    MS-Off Ver
    Excel 2010
    Posts
    293

    Re: Countif <>

    Thanks Ben. It worked. Thats a very intersting use of sumproduct you came up with, 1* <> nothing = 1 *1.

    I've often seen when sumproduct used with SUMPRODUCT(--(A2:A100<>"United States")*(A2:A100<>"")), what do those -- mean, and how does it affect the function?


    Again thanks very much for you're expeditious 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