How to count cells that contain numbers or dates
To count cells, within a given range or list of arguments, that contains only numbers you use the COUNT function.
- Dates and text that represent numbers are considered numbers and will therefore be counted.
- Logical values, text, or error values are not counted
Syntax
COUNT(value1,value2,…)
Examples:
COUNT(A1:A20) :counts numbers in a range of cells.
COUNT(A1:A20, 7) :counts numbers in a range of cells plus the second argument (7) which is counted as 1.
In the simple example depicted by the image below, cell B7 contains the function: =COUNT(B1:B6). The result is 4. as you can see the cells that contain the numbers 1, 2 and 17 and the cell that contains the date are counted. The the cells that contain the text “ABC” and “XYZ” are ignored.
Applies to: Excel 2003




hi…pls let me know how to find whether a particular cell contains digit….for Eg. rose1lotus…
November 10th, 2008 at 11:58 amHi,
I can’t think of a direct way to do this, but I have created a small user-defined function for this purpose. Please give it a try:
Function IfHasDigit(Cell As Range)
For i = 1 To Len(Cell.Value)
If IsNumeric(Mid(Cell.Value, i, 1)) Then
IfHasDigit = True
Exit Function
End If
Next i
IfHasDigit = False
End Function
Check this link for help on how to create a user defined function:
http://www.exceldigest.com/myblog/2008/04/12/how-to-create-a-user-defined-function/
November 10th, 2008 at 6:35 pm