Count Rows Matching Two Criteria with COUNTIFS in WPS Spreadsheets
Question details
Count records where the value in column A matches A2 and the value in column C matches C1.

- 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.
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.
Count exact matches in both columns with COUNTIFS
Use COUNTIFS when columns A and C must both match their respective criteria.
Open the worksheet in WPS Spreadsheets and click an empty cell where you want the count to appear.
Type =COUNTIFS(A5:A13,A2,C5:C13,C1) in the selected cell or formula bar, then press Enter.
Compare the result with rows 5 through 13. Only rows where column A matches A2 and column C matches C1 are counted.

Count matching rows within the month in C1
Use date boundaries when column C contains dates and you want to match the month and year of the date in C1.
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. Open the workbook: Open WPS Spreadsheets and select Open to load your spreadsheet.
- 2. Check the criteria: Enter or verify the values to match in cells A2 and C1.
- 3. Add the formula: Click an empty cell, enter =COUNTIFS(A5:A13,A2,C5:C13,C1), and press Enter.
- 4. Save the result: Select File > Save or Save As to save the workbook, choosing XLSX if you need an Excel-compatible file.

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.




