Finding numeric characters using wildcards in countif

I have a countif function in which I want to count those cells that have a numeric character.

Column A
Rich-Dilg-street 3
I have 4 apples
I have seven dogs

How do I write criteria countifusing wildcards so that I can count those that have a numeric character? In the above example, the answer should be 2 (1 and 2 are not 3)

+4
source share
3 answers

Use the ACCOUNT function with several indifferent criteria.

=SUM(COUNTIF(A:A, {"*0*","*1*","*2*","*3*","*4*","*5*","*6*","*7*","*8*","*9*"}))

As pointed out by Scott Craner , you can reduce input with

=SUM(COUNTIF(A:A, "*"&{0,1,2,3,4,5,6,7,8,9}&"*"))
+12
source

Try:

For Each Cell in Thisworkbook.Sheets(1).Range("A1:A10")
    For x = 1 to Len(Cell.Value)
        If IsNumeric(Mid(Cell.Value, x, 1)) Then
            Cell.Offset(0,1).Value = True
            Exit For
        End If
    Next x
Next Cell
+1
source

count, find countif .

A,

=count(FIND({0,1,2,3,4,5,6,7,8,9},A1))>0 will return True else false

countif

=countif(B:B,True)

, .

enter image description here

0

Source: https://habr.com/ru/post/1649415/


All Articles