Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Counting number of cells with non zero value

  1. #1
    New Member
    Join Date
    Aug 2010
    Posts
    15
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Counting number of cells with non zero value

    Hi,

    consider the following table:

    A1, A2, A3, A4
    Count, value1, value2, value3
    ...x..., 12345, 23423, 0
    ...y..., 0, 324234234, 0

    How to count the number of cells containing non-zero values in a row?

    X should be 2 and Y should be 3.

    It is easy to check the validity of on cell like : =IF(A2>0,"1","0").

    But how to extend the range where the check has to be done, like (A2:A4).

    Pls help,
    Thanks

  2. #2
    Board Regular Domski's Avatar
    Join Date
    Jan 2005
    Location
    Leeds, UK
    Posts
    7,292
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Counting number of cells with non zero value

    =COUNTIF(A2:A4,">"&0)

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    - Guidelines For Posting

    - Mr Excel Articles and PodCasts

    - Display sheet using HTML Maker or Excel Jeanie

    - Something that makes me laugh

    - Please try to remember to use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    New Member
    Join Date
    Aug 2010
    Posts
    15
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Counting number of cells with non zero value

    Quote Originally Posted by Domski View Post
    =COUNTIF(A2:A4,">"&0)

    Dom
    Thanks Dom, that was quick and it works perfectly...

  4. #4
    New Member
    Join Date
    Feb 2016
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Counting number of cells with non zero value

    It's now six years later and this just saved me so much work... Thanks, internet!

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.
     


DMCA.com