+ Reply to Thread
Results 1 to 6 of 6

Sumproduct or array formula for counting criteria of sum of cells

  1. #1
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208

    Sumproduct or array formula for counting criteria of sum of cells

    I need to count the number of rows where the sum of 3 columns is > 0. So, something like this:

    =COUNTIF(DB8:DB7964,">0")

    But for the results of the sum of colums DB:DD. I can easily do this via a helper column, but is it possible without the helper column?

    TIA

    Jason

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    You could use

    =SUMPRODUCT(--(DB8:DB7964+DC8:DC7964+DD8:DD7964>0))

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    One way

    =SUMPRODUCT(--(DB1:DB1000>0)*(DC1:DC1000>0)*(DD1:DD1000>0))

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  4. #4
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Well, I guess I should have figured that one out. Thanks!

  5. #5
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Quote Originally Posted by VBA Noob
    One way

    =SUMPRODUCT(--(DB1:DB1000>0)*(DC1:DC1000>0)*(DD1:DD1000>0))

    VBA Noob
    Thanks VBA Noob, but that will not work for my scenario. For example, if DB8 is 9, DC8 is -9, and DD8 is 5, then the sum is > 0, which should be counted. Your formula will result in 0 in this case, since DC8 is < 0.

    DDL's formula worked for me. Thanks for the help guys.

  6. #6
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Here is an overview of the Sumproduct function:

    http://www.xldynamic.com/source/xld.SUMPRODUCT.html

+ 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