+ Reply to Thread
Results 1 to 5 of 5

COUNTIF of an array not working

  1. #1
    Forum Contributor
    Join Date
    06-17-2012
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    150

    COUNTIF of an array not working

    I just installed Excel 2016 and thought this would be a straight forward calculation, but I cannot get it to work.

    I want to count how many results from the following array are non-zero,

    {=IF((E13:E32)*(W13:W32)>0,(W13:W32))*1}

    When I use COUNTIF it would give me a prompt to use (') in the formula which does not make sense. Here is the formula I am entering,

    {=COUNTIF(IF((E13:E32)*(W13:W32)>0,(W13:W32))*1,">0")}

    Any help will be greatly appreciated.

    Thanks.

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: COUNTIF of an array not working

    Try (non-array formula)

    =SUMPRODUCT(--((E13:E32*W13:W32)>0))

    or

    =COUNTIFS(E13:E32,">0",W13:W32,">0")

    Arrays are not valid in the first part of countif, you can use ranges, or functions that return ranges (i.e. index, offset, indirect).
    Last edited by jason.b75; 03-13-2016 at 11:00 AM.

  3. #3
    Forum Contributor
    Join Date
    06-17-2012
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    150

    Re: COUNTIF of an array not working

    Excellent! It works. Thanks.

  4. #4
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: COUNTIF of an array not working

    Try these
    =SUMPRODUCT(--(E13:E22*W13:W22<>0))

  5. #5
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: COUNTIF of an array not working

    You're welcome, thanks for the feedback!

    In case you missed it, I've edited my post to include an alternative method.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. countif not working
    By ammartino44 in forum Excel General
    Replies: 5
    Last Post: 04-15-2015, 01:11 PM
  2. [SOLVED] CountIF not working
    By Justair07 in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 01-28-2015, 04:08 PM
  3. [SOLVED] Countif not working
    By birdie27 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-27-2014, 02:31 AM
  4. COUNTIF array function not working
    By Excellentafrican in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-25-2013, 03:53 AM
  5. Assigning values into array using the "Array" vba function.......not working
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-17-2011, 04:21 PM
  6. Array Formula COUNTIF & SUM not working
    By jojithedevil in forum Excel General
    Replies: 2
    Last Post: 02-22-2010, 06:49 PM
  7. Countif not working
    By raydaw in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-27-2008, 10:18 AM

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