Function Problems

Count Text When an Adjacent Cell Is Numeric in Excel

Chanuka GeekiyanageChanuka Geekiyanage Nov 18, 2026 869 views

Question details

Count cells containing ABC only when the corresponding adjacent cell contains a numeric value.

Count Text When an Adjacent Cell Contains a Number in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
Text values are in one column and the adjacent column contains values that must be tested for numbers.
Observed behavior
The desired count includes exact ABC matches only where the adjacent cell is numeric.
Before you start

Identify the text range and adjacent value range, and make sure they cover the same rows. The examples below use A2:A10 for text and B2:B10 for adjacent values.

Solution 1Recommended

Use SUMPRODUCT to count text beside any number

Use this formula to include zero, positive numbers, and negative numbers while excluding blanks and text.

1
Select a result cell

Click an empty cell where you want the count to appear.

2
Enter the formula

Type =SUMPRODUCT((A2:A10="ABC")*ISNUMBER(B2:B10)) and press Enter.

3
Adjust the ranges

In the formula bar, replace A2:A10 and B2:B10 with your own same-sized ranges, and replace ABC with the text you want to count.

Use SUMPRODUCT to count text beside any number
Nonblank is not the same as numeric: A COUNTIFS condition of "<>" includes nonblank text as well as numbers. ISNUMBER tests for numeric values; dates stored as Excel numbers also qualify.
Count with WPS Spreadsheets

Count text beside numeric values in WPS Spreadsheets

Use SUMPRODUCT and ISNUMBER in WPS Spreadsheets to count matching text only when the adjacent cell contains a number.

  1. 1. Open the spreadsheet: Open WPS Spreadsheets and use Open to select your workbook.
  2. 2. Select a result cell: Click an empty cell where the count should appear.
  3. 3. Enter the formula: Type =SUMPRODUCT((A2:A10="ABC")*ISNUMBER(B2:B10)) and press Enter.
  4. 4. Adapt the formula: Use the formula bar to replace the sample ranges and ABC with your own ranges and text.
Count exact text matches beside numeric valuesExclude blanks and numbers stored as textOpen and edit Microsoft Excel XLSX and XLS filesWork in a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

Does the formula count zero and negative numbers?

Yes. ISNUMBER returns TRUE for zero, positive numbers, and negative numbers. Use the COUNTIFS criterion ">0" if only positive values should count.

Why isn't a number stored as text counted?

ISNUMBER treats a numeric-looking text value as text, not a number. Convert the value to a number before applying the formula if it should qualify.

Does the text match have to be exactly ABC?

Yes. The comparison A2:A10="ABC" matches the whole cell value, not text containing extra characters. It is not case-sensitive.

Will dates in the adjacent column be counted?

Yes. Excel stores dates as numeric values, so ISNUMBER returns TRUE for a valid stored date.