This is an overview.
The sample dataset has 4 columns: Rep. Name, Item, Units & Unit Cost and 13 rows.
You want to find the total number of cells that contain numbers in the Units column.
Example 1 – Combining the COUNT, IF, and the ISNUMBER Functions to Count Numeric Values in Excel
Steps:
- Select a cell (here, B19).
- Enter the following formula in B19.
=COUNT(IF(ISNUMBER(D5:D16),D5:D16))
D5:D16 is the range of values in the Units column.
Formula Breakdown
- ISNUMBER(D5:D16)→The ISNUMBER function returns TRUE if the cell contains a number. Otherwise FALSE.
- Output → {TRUE; TRUE; FALSE; TRUE; TRUE; FALSE; TRUE; FALSE; TRUE; TRUE; FALSE; TRUE}
- IF(ISNUMBER(D5:D16),D5:D16) → becomes
- IF({TRUE; TRUE; FALSE; TRUE; TRUE; FALSE; TRUE; FALSE; TRUE; TRUE; FALSE; TRUE}, D5:D16) →The IF function returns the numeric value for TRUE.
- Output → {53;56; FALSE; 59; 83; FALSE; 60; FALSE; 70; 96; FALSE; 68}
- IF({TRUE; TRUE; FALSE; TRUE; TRUE; FALSE; TRUE; FALSE; TRUE; TRUE; FALSE; TRUE}, D5:D16) →The IF function returns the numeric value for TRUE.
- COUNT(IF(ISNUMBER(D5:D16),D5:D16)) → becomes
- COUNT({53;56; FALSE; 59; 83; FALSE; 60; FALSE; 70; 96; FALSE; 68}) → counts numbers based on values.
- Output → 8
- COUNT({53;56; FALSE; 59; 83; FALSE; 60; FALSE; 70; 96; FALSE; 68}) → counts numbers based on values.
- Press ENTER and the result will be displayed in B19.
Read More: Use ISNUMBER Function with IF and Then Statements in Excel
Example 2. Applying the COUNTIF Function with the Asterisk (*) Operator to Check Numeric Values and Count Them
Steps:
- Select a cell (here, B19).
- Enter the following formula in B19.
=COUNTIF(D5:D16, "<>*")
D5:D16 is the range of values in the Units column.
- Press ENTER and the result will be displayed in B19.
Read More: Excel ISNUMBER Not Working
Example 3 – Combining the Excel SUMPRODUCT with ISNUMBER to Count Numeric Values
Steps:
- Select a cell (here, B19).
- Enter the following formula in B19.
=SUMPRODUCT((--ISNUMBER(D5:D16)))
D5:D16 is the range in the Units column.
Formula Breakdown
- ISNUMBER(D5:D16) → The ISNUMBER function checks if the value is a number. It returns TRUE if the cell contains a number. Otherwise, FALSE.
- Output → {TRUE; TRUE; FALSE; TRUE; TRUE; FALSE; TRUE; FALSE; TRUE; TRUE; FALSE; TRUE}
- –ISNUMBER(D5:D16) → becomes
- –ISNUMBER({TRUE; TRUE; FALSE; TRUE; TRUE; FALSE; TRUE; FALSE; TRUE; TRUE; FALSE; TRUE}) → The double negative (—) symbol converts the boolean values into numeric values.
- Output → {1;1;0;1;1;0;1;0;1;1;0;1}
- –ISNUMBER({TRUE; TRUE; FALSE; TRUE; TRUE; FALSE; TRUE; FALSE; TRUE; TRUE; FALSE; TRUE}) → The double negative (—) symbol converts the boolean values into numeric values.
- SUMPRODUCT((–ISNUMBER(D5:D16))) → becomes
- SUMPRODUCT({1;1;0;1;1;0;1;0;1;1;0;1}) →The SUMPRODUCT function counts numeric values and returns their summation.
- Output → 8
- SUMPRODUCT({1;1;0;1;1;0;1;0;1;1;0;1}) →The SUMPRODUCT function counts numeric values and returns their summation.
- Press ENTER and the result will be displayed in B19.
Example 4 – Counting Numeric Values Based on Conditions by Using the Excel COUNTIF Function
i. Counting Numeric Values Equal to a Defined Value
Steps:
- Select a cell (here, E18).
- Entert the following formula in E18.
=COUNTIF(E5:E16, E5)
E5:E16 is the range in the Unit Cost column and the criterion is 35 – E5.
- Press ENTER to see the result in E18.
ii. Counting Numeric Values Greater Than a Defined Value
- Select E19.
- Enter the following formula in E19.
=COUNTIF(E5:E16,">35")
E5:E16 is the range in Unit Cost column and the criterion is 35.
- Press ENTER to see result in E19.
iii. Counting Values Less Than a Defined Value
Steps:
- Select E20.
- Enter the following formula in E20.
=COUNTIF(E5:E16,"<6")
E5:E16 is the range in the Unit Cost column and the criterion is 6.
- Press ENTER to see the result in E20.
iv. Counting Total Cells with Values That Are Not Equal to a Value
Steps:
- Select E21.
- Enter the following formula in E21.
=COUNTIF(E5:E16,"<>35")
HE5:E16 is the range in the Unit Cost column and the criterion is 35.
- Press ENTER to see the result in E21.
The picture below showcases all methods used in Example 4.
Practice Section
Practice here.
Download Practice Workbook
<< Go Back to Excel ISNUMBER Function | Excel Functions | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!