• COUNTIF ” (2002 SP3)

    • This topic has 9 replies, 6 voices, and was last updated 19 years ago.
    Author
    Topic
    #430269

    Hi y’all
    Apart from =SUMPRODUCT((LEN(A1:A35)0)*1) can anyonne think of a way (using COUNTIF maybe) that I can count the cells in a column that are not equal to “”

    TIA
    Regards
    Paul

    Viewing 1 reply thread
    Author
    Replies
    • #1004198

      I would enter an array function:

      =sum(if(A$1:A$35 “”,1) formula has to be entered with ctrl-shift-enter

      since I could change the test to be = “Doug” or >5 etc. at some later date

      On the other hand, if I know it is just non-blanks I would ever be worried about,

      =counta(A$1:A$35)

      will work, too…

      • #1004199

        [indent]


        =sum(if(A$1:A$35 “”,1)


        [/indent] That is equivalent to =SUMPRODUCT((A1:A35″”)*1) since SUMPRODUCT is an implicit array function.

        [indent]


        =counta(A$1:A$35)


        [/indent] won’t work because the cells are equal to “” (from an if statement) rather than blank.

        • #1004202

          (Edited by Jezza on 11-Mar-06 23:11. To add PS)

          Hi Paul

          I think this is what you are wanting, I have tried it out with a range that contained a couple of if statements and some blanl cells and it seems to work:

          =(ROWS(A1:A35)*COLUMNS(A1:A35))-COUNTBLANK(A1:A35)

          Good luck

          PS
          If it is just Column A with this then it can be further simplified:

          =ROWS(A:A)-COUNTBLANK(A:A)

    • #1004206

      =COUNT(Range)+COUNTIF(Range,”?*”)

      • #1004208

        Hello Aladin,

        Unless I’m mistaken, your formula doesn’t take TRUE/FALSE values into account ( I assume that the original poster wants to count those as not “”)

        • #1004209

          Hoi Hans,

          That’s right.

          Closer to the SumProduct formula in behavior:

          =COUNTA(Range)-COUNTIF(Range,””)

          The error values would also be counted in by the foregoing formula.

          However, I just assumeed that only text and numeric values would be of interest.

          Aladin

          • #1004213

            Yes, if only text and number values are of interest, the formula from your previous reply will do the job nicely. Otherwise, Jezza’s formulas are probably best, because they cover all situations. COUNTA doesn’t count really blank cells (it does count cells that are blank as the result of a formula).

            • #1004219

              [indent]


              COUNTA doesn’t count really blank cells (it does count cells that are blank as the result of a formula).


              [/indent]

              They are not really blank if they contain a formula. A blank cell is an empty cell. If a formula is in a cell, it is not empty. A null string is a zero length string. smile

              Steve

            • #1004237

              Thanks for all the replies guys.

              In this application the cells that I am interested in have a formula that return text or “”. Sad @#$!% that I am, I figured out whilst trying to get to sleep last night that =COUNTA(A:A,”?*”) should get me what I need for this. However I shall store Jezza’s and Aladin’s ideas away for future use.

              Thanks once again.

    Viewing 1 reply thread
    Reply To: COUNTIF ” (2002 SP3)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: