• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

COUNTIF is not picking up a ":"

My COUNTIF formula is not picking up a colon in cell A3:

Code:
=COUNTIF(A3,":")

There is text on both sides of the colon. The data was downloaded from QuickBooks and the cell is text format. It returns a 0.

What is wrong with my formula?
 
Hello,

What about this:

=SUM(--(LEN(SUBSTITUTE(B1:B4,":",))<LEN(B1:B4)))

where B1:B4 is the range in question. Executed as an array, by using Ctrl+Shift+Enter instead of Enter alone.

There's probably a shorter way to do this...
 
If you are not counting a range of multiple cells -- and you only want to return a 1 or 0 value, depending on whether A3 includes ":", you could:

=--(LEN(SUBSTITUTE(A3,":",))<LEN(A3))

or even

=IFERROR(FIND(":",A3)^0,0)

without CSE.
 
Hi,
I think COUNTIF will not work the way you are trying...
Try:
=SEARCH(":",A3)

or go with eibi..

Regards,
 
My guess from the OP response is that the requirement is to count the number of colons which occur in a range.

@DashboardNovice
COUNTIF, such as the formula suggested by Faseeh, will count the number of cells which contain a ":". If you want to count the actual number of colons then you can use a formula such as:

=SUMPRODUCT(LEN(A3:A100)-LEN(SUBSTITUTE(A3:A100,":","")))


This formula assumes A3:A100 contains text data types.
 
Back
Top