+ Reply to Thread
Results 1 to 7 of 7

Count, Countif?? - How to count a portion of a list

  1. #1
    Registered User
    Join Date
    08-06-2010
    Location
    Los Angeles
    MS-Off Ver
    Excel 2007
    Posts
    7

    Count, Countif?? - How to count a portion of a list

    I have no idea if this is super simple (that is my guess) or not possible. Essentially I have a repeating list of numbers and I want to count the ones that fall within zeros on each side. Ex.

    Days Count
    0 0
    0 0
    1 5
    2 5
    3 5
    4 5
    5 5
    0 0
    0 0
    1 3
    2 3
    3 3
    0 0
    0 0



    I would like to have Excel count each set of non-zero numbers and display that number in the next colum. What kind of formula would i use? Thanks.
    Attached Files Attached Files
    Last edited by socalboarder; 08-07-2010 at 12:12 AM. Reason: Changing Title

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Count, Countif?? - How to count a portion of a list

    maybe

    =COUNTIFS(A2:A15,"<>0",B2:B15,"<>0")

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: Count, Countif?? - How to count a portion of a list

    or this:

    =SUMPRODUCT(--(A2:A100*B2:B100<>0))

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Count, Countif?? - How to count a portion of a list

    zbor, in Excel 2007 and later, Countifs will be preferable to Sumproduct, since it's much faster ...

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: Count, Countif?? - How to count a portion of a list

    ty teylin.. Knew that... however, posting same solution twice doesn't have much effect

  6. #6
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Count, Countif?? - How to count a portion of a list

    Hmm. If you don't have anything to post that improves the existing suggestions, there's always the tacit option.

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Count, Countif?? - How to count a portion of a list

    to get it like the op's required solution try attached
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ 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