Use COUNTIFS in Excel to Count Survey Results by Multiple Criteria
Question details
Count survey rows that match several criteria without nesting XLOOKUP functions.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A survey worksheet contains group, location, and question values that must all match specified criteria.
- Observed behavior
- The desired result is a count of rows where all three criteria match.
Identify the columns containing the survey group, location, and question, along with the cells holding the criteria. Make sure all criteria ranges cover the same number of rows.
Count Matching Survey Rows with COUNTIFS in Excel
Use one criteria range and criterion pair for each condition that a survey row must meet.
COUNTIFS counts rows only when all specified conditions are met. It returns a count rather than a value from a matching row.
In the worksheet, use O2:O7 for groups, P2:P7 for locations, and Q2:Q7 for questions. Use C2, E2, and F2 for the corresponding criteria, or adjust the references to match your sheet.
Select the cell where you want the count and enter =COUNTIFS($O$2:$O$7,C2,$P$2:$P$7,E2,$Q$2:$Q$7,F2), then press Enter.
Drag the fill handle down to count matches for criteria in other rows. The dollar signs keep the survey ranges fixed while the criteria references change.

Use COUNTIFS for Survey Counts in WPS Spreadsheets
Open your survey workbook in WPS Spreadsheets and use COUNTIFS to count rows that match the group, location, and question criteria.
- 1. Open the workbook: In WPS Spreadsheets, choose Open and select your survey workbook.
- 2. Identify the criteria: Check the group, location, and question columns and the cells containing the values you want to match.
- 3. Enter COUNTIFS: Select a result cell and enter =COUNTIFS($O$2:$O$7,C2,$P$2:$P$7,E2,$Q$2:$Q$7,F2), adjusting the references to your worksheet, then press Enter.
- 4. Apply the formula to other rows: Drag the result cell's fill handle down if you have additional criteria rows to count.

Frequently Asked Questions
How does COUNTIFS combine multiple conditions?
COUNTIFS counts a row only when every specified condition matches. Add each condition as a criteria range followed by its criterion in the formula.
Why does my COUNTIFS formula return an error?
Check that every criteria range covers the same number of rows and columns. For example, O2:O7, P2:P7, and Q2:Q7 are all six rows tall.
Can COUNTIFS return a survey answer instead of a count?
No. COUNTIFS returns the number of matching rows. To return a value from a matching row, use a lookup formula such as XLOOKUP instead.
Why are there dollar signs in the criteria ranges?
The dollar signs in references such as $O$2:$O$7 keep the survey range fixed when you drag the formula to another row. References such as C2 change as the formula is copied.




