To determine if a cell contains a number, we can use the COUNT, COUNTIF, SUBTOTAL, COUNTIFS, SUBTOTAL, and ISNUMBER functions. Consider the following dataset, where we’ll find how many sizes are numbers.
We have used the following table where we have arranged some dresses in the Product, Size, and Price columns. Let’s count the number of cells with numbers in the Size column.
Method 1 – Use COUNT Function to Count Cells with Number
Steps:
- Select a cell (i.e. D15) to put your output in.
- Insert the following formula into that cell:
=COUNT(C5:C13)
- Here, C5:C13 is the range of values.
Method 2 – Apply COUNTIF Function to Count Cells with Number
Steps:
- Type the following formula in your preferred cell and press Enter to count cells with numbers:
=COUNTIF(C5:C13,"<>*")
- Here, C5:C13 is the range of values and before the wildcard, <> is used which means Not Equal to any texts.
Method 3 – Use SUBTOTAL function to Count Cells with Number
Steps:
- Pick a cell for the desired output and apply the following formula for counting cells with numbers:
=SUBTOTAL(102,C5:C13)
- Here, 102 is used to signify using the COUNT function inside SUBTOTAL’s syntax (also telling Excel to ignore hidden rows) and C5:C13 is the range of values.
Method 4 – Apply COUNTIFS Function to Count Cells with Number
Steps:
- Apply the following formula to have the total number of cells with a number:
=COUNTIFS(B5:B13,"*Shoe*",D5:D13,">1500")
- Here, B5:B13 is the first criteria range and Shoe is the first criteria. Moreover, D5:D13 is the second criteria range, and “>1500” is the second criterion.
Method 5 – Combine SUMPRODUCT and ISNUMBER Functions to Count Cells with Number
Steps:
- Select a cell (i.e. D15) for your output.
- Copy the following formula into that cell:
=SUMPRODUCT((--ISNUMBER(C5:C13)))
- Here, C5:C13 is the range of the ISNUMBER function.
⧪ Formula Breakdown ⧪
–ISNUMBER(C5:C13) —> checks whether the values in those cells are text or number.
Output: {0;0;1;0;0;1;0;0;1}
SUMPRODUCT((–ISNUMBER(C5:C13)))
SUMPRODUCT(({0;0;1;0;0;1;0;0;1})) —> returns the sum of the previous check.
Output: 3
Download Workbook
Download this practice workbook to exercise while you are reading this article.
<< Go Back to Count Cells | Formula List | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!
Thank you for this. Method 5 solved my problem. This article was very helpful.
Hello Rebecca A,
You are most welcome. Glad to hear that the method 5 solved your problem. Keep learning Excel with ExcelDemy!
Regards
ExcelDemy