+ Reply to Thread
Results 1 to 9 of 9

How to COUNT IF NOT

  1. #1
    Registered User
    Join Date
    07-02-2008
    Location
    Winnipeg, MB
    Posts
    57

    How to COUNT IF NOT

    I've calculated the count of each of my products in column A (Products A, B, C and D) if the product has an associated score in column B; however, I still need to calculate the count of products E, F, G, H, I, J and K if they have scores (grouped together as "other").

    Here's and example of the formula that I've used to calculate the count of product A if column B has a score: {=COUNT(IF($A$2:$A$60000="Product A",IF($B$2:$B$60000<>"",$B$2:$B$60000)))}

    Basically I'm struggling with combining IF not statements. So, count if column A does not have products A, B, C, D and has an associated score in column B.

    I hope this makes sense...

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try:

    =COUNT(IF(ISNA(MATCH($A$2:$A$6000,{"Product A","Product B","Product C","Product D"},0)),IF($B$2:$B$6000<>"",1)))

    confirmed with CTRL+SHIFT+ENTER
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    How to COUNT IF NOT

    Try this:

    Please Login or Register  to view this content.
    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  4. #4
    Registered User
    Join Date
    07-02-2008
    Location
    Winnipeg, MB
    Posts
    57
    Okay, great - both make sense. But what if I want to calculate the average score of "other" in column B

    So, average if column A does not have products A, B, C, D and has an associated score in column B.

    I treid this and it didn't work:
    Please Login or Register  to view this content.

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try:

    =AVERAGE(IF(ISNA(MATCH($A$2:$A$6000,{"A","B","C","D"},0)),IF($B$2:$B$6000<>"",$B$2:$B$6000)))

    confirmed with CTRL+SHIFT+ENTER

  6. #6
    Registered User
    Join Date
    07-02-2008
    Location
    Winnipeg, MB
    Posts
    57
    Quote Originally Posted by NBVC
    Try:

    =AVERAGE(IF(ISNA(MATCH($A$2:$A$6000,{"A","B","C","D"},0)),IF($B$2:$B$6000<>"",$B$2:$B$6000)))

    confirmed with CTRL+SHIFT+ENTER
    PERFECT! Thanks!
    Last edited by Vbort44; 07-08-2008 at 12:54 PM.

  7. #7
    Registered User
    Join Date
    07-02-2008
    Location
    Winnipeg, MB
    Posts
    57
    Quote Originally Posted by NBVC
    Try:

    =COUNT(IF(ISNA(MATCH($A$2:$A$6000,{"Product A","Product B","Product C","Product D"},0)),IF($B$2:$B$6000<>"",1)))

    confirmed with CTRL+SHIFT+ENTER
    Now it's starting to get difficult. What if I had two statements that had to be true to calculate average in column B. Let's say that product b had to be found in column a and I had a column C with either "true" or blank in the column. For example:

    Count if column A matches product B, has an associated score in column B AND matches "true" in column C.

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    You can just add another nested IF()

    e.g.

    =COUNT(IF($A$2:$A$6000="Product B",IF($C$2:$C$6000=TRUE,IF($B$2:$B$6000<>"",1))))

  9. #9
    Registered User
    Join Date
    07-02-2008
    Location
    Winnipeg, MB
    Posts
    57
    Quote Originally Posted by NBVC
    You can just add another nested IF()

    e.g.

    =COUNT(IF($A$2:$A$6000="Product B",IF($C$2:$C$6000=TRUE,IF($B$2:$B$6000<>"",1))))
    Ah, but of course, thanks!

+ 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