+ Reply to Thread
Results 1 to 6 of 6

COUNTIF without counting blank cells

  1. #1
    Registered User
    Join Date
    03-03-2010
    Location
    Aarhus, Danmark
    MS-Off Ver
    Excel 2007
    Posts
    7

    COUNTIF without counting blank cells

    Hi,

    I am trying to build a model, but I have some problems.

    Say I have a row with data, like:

    Total:
    12
    10
    8
    5
    12
    5
    ect....

    I want to count how many of the numbers are > 9.5.

    I used this formula: =COUNTIF(F4:F22;">=9,5") , and it works fine.

    However, there is some missing data, that is gonna get added on the way. Like a bunch of blank/0 cells. Looks like this:

    Total:
    12
    10
    8
    5
    12
    5
    0
    0
    0
    0
    0
    ect....

    Is there any way to add something to the COUNTIF formula to exclude the blank cells from being counted?

    Any help is appriciated.

    Kasper
    Last edited by Melgaard; 03-03-2010 at 11:50 PM.

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: COUNTIF without counting blank cells

    Hi Kasper & Welcome to the Board,

    Given the example with the zeros what answer do you expect? If I take your example I get 3, 3 numbers greater than or equal to 9.5.

  3. #3
    Registered User
    Join Date
    03-03-2010
    Location
    Aarhus, Danmark
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: COUNTIF without counting blank cells

    Thank you jeffrey.

    I should have explained myself better.

    Here is how some of the actual model looks like:

    Total
    12
    10
    9
    8
    8
    7
    12
    8
    14
    14
    12
    13
    9
    8
    0
    0
    0
    0
    0

    I want to count the amount of > 9.5 and < 9.5. I figured out how to do that.

    My problem is that the last 5 entries of data haven't occured yet, so for now my calculations look like this:

    Over 9.5: 7

    Under 9.5: 12

    When under 9.5 in reality should be 7.

    So I would like to count the data without the blank/0 cells untill data is entered there.

    If that makes in sense

  4. #4
    Registered User
    Join Date
    03-03-2010
    Location
    Aarhus, Danmark
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: COUNTIF without counting blank cells

    Oh, wow I'm really stupid. I thought that leaving a cell with a 0 and leaving it totally blank was the same

    You can close this for now, I am gonna post something later when I have troubles with things.

    Thanks

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: COUNTIF without counting blank cells

    How about...

    =SUMPRODUCT(--($A$1:$A$19<9.5),--($A$1:$A$19>0))

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: COUNTIF without counting blank cells

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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