Function Problems

Use Excel COUNTIFS to Count Matching Rows Across Worksheets

Anum MushtaqAnum Mushtaq Nov 14, 2026 869 views

Question details

Count rows on one worksheet where an identifier matches a cell on another worksheet and a second column contains text.

Use Excel COUNTIFS to Count Matching Rows Across Worksheets
Product
Microsoft Excel
Device & OS
not provided
Scenario
The formula is entered in Type1Dem!D4 and checks Type1List column B against Type1Dem!B4 and column G for text.
Observed behavior
The desired result is a count of Type1List rows that meet both criteria on the same row.
Before you start

Check that the worksheet names are Type1List and Type1Dem, and that the identifier to match is in Type1Dem!B4. Confirm that Type1List columns B and G contain the identifiers and text to be checked.

Solution 1Recommended

Count matching rows that contain text with COUNTIFS

Use this formula when column G must contain at least one text character.

COUNTIFS evaluates the criteria on the same row. The wildcard criterion "?*" matches text containing at least one character; it does not count numeric values in column G.

1
Select the result cell

Open the Type1Dem worksheet and select cell D4.

2
Enter the formula

Enter =COUNTIFS(Type1List!B:B,Type1Dem!B4,Type1List!G:G,"?*") in D4 and press Enter.

3
Check the result

Compare the count with rows on Type1List where column B matches Type1Dem!B4 and column G contains text.

Count matching rows that contain text with COUNTIFS
Adjust the references: Replace B4 if the identifier is in a different cell. You can also use bounded ranges such as Type1List!B2:B1000 and Type1List!G2:G1000; both ranges must cover the same rows.
WPS Spreadsheets

Count matching worksheet rows in WPS Spreadsheets

Use COUNTIFS in WPS Spreadsheets to match an identifier across worksheets and count rows containing text.

  1. 1. Open the workbook: Open WPS Spreadsheets, select Open, and choose the workbook containing Type1List and Type1Dem.
  2. 2. Select the result cell: Click the Type1Dem worksheet tab and select D4.
  3. 3. Enter COUNTIFS: Type =COUNTIFS(Type1List!B:B,Type1Dem!B4,Type1List!G:G,"?*") and press Enter.
  4. 4. Save the workbook: Select Save to keep the formula in the workbook.
Apply multiple COUNTIFS criteria to the same rowOpen and edit Microsoft Excel XLSX and XLS filesUse familiar spreadsheet formulas and worksheet referencesWork with a free, easy-to-use office suite
microsoft office alternative - wps office

Frequently Asked Questions

What is the difference between "?*" and "<>" in COUNTIFS?

The criterion "?*" matches text with at least one character. The criterion "<>" checks for nonblank values, including numbers.

Can I copy the formula down for other identifiers?

Yes. Enter the formula in Type1Dem!D4 and drag its fill handle down. The B4 reference changes to B5, B6, and so on.

How do I reference a worksheet name that contains spaces?

Put single quotation marks around the sheet name, as in 'Type 1 List'!B:B. Use the exact worksheet name in each range reference.

Why might COUNTIFS return an unexpected count?

Check that the identifier in Type1Dem!B4 matches the values in Type1List column B and that column G contains the type of value your criterion is intended to count. Also check for spaces in the source data.