GTO
06-13-2014, 10:04 PM
Hi All :hi:
A hopefully easy/quick question, or more at confirmation...
In the Help topic for COUNTIF() in 2010 Help, in the example(s) area, it is stated:
=COUNTIF(A2:A7,"*") Number of cells containing any text in cells A2 through A7.
I believe this is incorrect, as if I have:
=COUNTIF(B$136:B$155,"*")
... and B$136:B$155 contain formulas that either return a string (employees' names in this case), or, return an "" (empty string), then even the cells returning empty strings are added/counted; just like if I were to use COUNTA().
If I add a question mark (insist upon at least one character) however:
=COUNTIF(B$136:B$155,"?*")
...then it appears to return the count of cells containing text, as is desired.
To test and hopefully confirm my assumption that the '*' is being treated as one would expect (zero to many characters), I essentially repeated by testing on a blank/new sheet. With 'Amy', 'Lisa' and nothing in A1:A3, and the formula =IF(LEN(A1)>0,A1,"") in B1 and drug down, the formulas =COUNTIF(A1:A3,"*") and = COUNTIF(B1:B3,"*") returned 2 and 3 respectively. Again, if I added the question mark, then both formulas accurately reported '2' accurately.
So, I thought I'd pose this question to make sure that the help topic's example is in error, just to ensure that I'm not presuming anything incorrectly and actually missing something...
Thank you in advance,
Mark
A hopefully easy/quick question, or more at confirmation...
In the Help topic for COUNTIF() in 2010 Help, in the example(s) area, it is stated:
=COUNTIF(A2:A7,"*") Number of cells containing any text in cells A2 through A7.
I believe this is incorrect, as if I have:
=COUNTIF(B$136:B$155,"*")
... and B$136:B$155 contain formulas that either return a string (employees' names in this case), or, return an "" (empty string), then even the cells returning empty strings are added/counted; just like if I were to use COUNTA().
If I add a question mark (insist upon at least one character) however:
=COUNTIF(B$136:B$155,"?*")
...then it appears to return the count of cells containing text, as is desired.
To test and hopefully confirm my assumption that the '*' is being treated as one would expect (zero to many characters), I essentially repeated by testing on a blank/new sheet. With 'Amy', 'Lisa' and nothing in A1:A3, and the formula =IF(LEN(A1)>0,A1,"") in B1 and drug down, the formulas =COUNTIF(A1:A3,"*") and = COUNTIF(B1:B3,"*") returned 2 and 3 respectively. Again, if I added the question mark, then both formulas accurately reported '2' accurately.
So, I thought I'd pose this question to make sure that the help topic's example is in error, just to ensure that I'm not presuming anything incorrectly and actually missing something...
Thank you in advance,
Mark