Function Problems

Count Rows Matching Two Criteria with COUNTIFS in WPS Spreadsheets

John WilsonJohn Wilson Dec 2, 2026 868 views

Question details

Count records where the value in column A matches A2 and the value in column C matches C1.

Count Rows Matching Two Criteria with COUNTIFS in WPS Spreadsheets
Product
WPS Spreadsheets
Device & OS
not provided
Scenario
A spreadsheet contains records in rows 5 through 13, and the user wants to count rows satisfying both criteria.
Observed behavior
The desired result is a count of rows where both comparisons are true.
Before you start

Check that A5:A13 and C5:C13 cover the same rows, and that A2 and C1 contain the values you want to match. If matching by month, make sure C1 and the dates in column C are recognized as dates.

Solution 1Recommended

Count exact matches in both columns with COUNTIFS

Use COUNTIFS when columns A and C must both match their respective criteria.

1
Select a result cell

Open the worksheet in WPS Spreadsheets and click an empty cell where you want the count to appear.

2
Enter the formula

Type =COUNTIFS(A5:A13,A2,C5:C13,C1) in the selected cell or formula bar, then press Enter.

3
Check the result

Compare the result with rows 5 through 13. Only rows where column A matches A2 and column C matches C1 are counted.

Count exact matches in both columns with COUNTIFS
SUMPRODUCT alternative: You can also enter =SUMPRODUCT((A5:A13=A2)*(C5:C13=C1)) in an empty cell to count rows that satisfy both comparisons.
Count matching spreadsheet records

Count rows with multiple criteria in WPS Spreadsheets

Use COUNTIFS in WPS Spreadsheets to count records that match values in two columns, then save the workbook in an Excel-compatible format.

  1. 1. Open the workbook: Open WPS Spreadsheets and select Open to load your spreadsheet.
  2. 2. Check the criteria: Enter or verify the values to match in cells A2 and C1.
  3. 3. Add the formula: Click an empty cell, enter =COUNTIFS(A5:A13,A2,C5:C13,C1), and press Enter.
  4. 4. Save the result: Select File > Save or Save As to save the workbook, choosing XLSX if you need an Excel-compatible file.
Count rows only when both criteria are metUse date boundaries to count records within a monthOpen and save Microsoft Excel XLSX filesWork with formulas in a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

How do I count rows only when both criteria match?

Enter =COUNTIFS(A5:A13,A2,C5:C13,C1) in an empty cell. COUNTIFS counts a row only when both conditions are true.

Can I use SUMPRODUCT instead of COUNTIFS?

Yes. Enter =SUMPRODUCT((A5:A13=A2)*(C5:C13=C1)) in an empty cell to count rows where both comparisons are true.

Why should the criteria ranges cover the same rows?

COUNTIFS compares corresponding positions in each range, so use ranges of the same size that start and end on the same rows, such as A5:A13 and C5:C13.

How can I match a month instead of an exact date?

Put a date from the desired month in C1, then use COUNTIFS with a lower boundary of EOMONTH(C1,-1)+1 and an upper boundary of EOMONTH(C1,0)+1. This matches the month and year, including dates with times.