How to Count If Cell Contains Number in Excel: 5 Smart Ways

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.

Overview to Count If Cell Contains Number


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.

Dataset to Count If Cell Contains Number


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.

Use COUNT Function to Count Cells with Number


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.

Apply COUNTIF Function to Count Cells with Number


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.

return of the SUBTOTAL function


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.

Apply COUNTIFS Function to Count Cells with Number


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.

output of the SUMPRODUCT and ISNUMBER Functions

⧪ 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!
Tanjima Hossain
Tanjima Hossain

TANJIMA HOSSAIN is a marine engineer who enjoys working with Excel and VBA programming. For her, programming is a handy, time-saving tool for managing data, files, and online tasks. She's skilled in Rhino3D, Maxsurf C++, MS Office, AutoCAD, and Excel & VBA, going beyond the basics. She holds a B.Sc. in Naval Architecture & Marine Engineering from BUET and is now a content developer. In this role, she creates tech-focused content centred around Excel and VBA. Apart from... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo