Function Problems

How to Count Adults and Children Who Selected Yes in Excel

Jason MillerJason Miller Nov 10, 2026 868 views

Question details

The user needs an Excel formula to count the total number of adults ('A') and children ('K') who selected 'Yes' in a separate response column.

How to Count Adults and Children Who Selected Yes in Excel
Product
Excel / WPS Spreadsheet
Device & OS
not provided
Scenario
Evaluating survey or demographic data where respondents are categorized into age groups and their responses to a specific question are recorded.
Observed behavior
The goal is to calculate a combined count using multiple criteria across two different columns (category and response).
Before you start

Ensure your data is organized cleanly into separate columns, with one column containing the demographic categories (e.g., 'A' and 'K') and another containing the exact text responses (e.g., 'Yes').

Solution 1Recommended

Use COUNTIFS with Addition

You can calculate the total by using two separate COUNTIFS functions and adding their results together.

The COUNTIFS function allows you to count cells that meet multiple criteria. By creating one COUNTIFS formula for adults who answered 'Yes' and another for children who answered 'Yes', you can easily sum them up for the final total.

1
Select the target cell

Click on the empty cell where you want the final count to appear.

2
Enter the first COUNTIFS function

Type =COUNTIFS(A2:A100,"A",B2:B100,"Yes") to count the adults.

3
Add the second COUNTIFS function

Add a plus sign (+) and type the second formula: COUNTIFS(A2:A100,"K",B2:B100,"Yes"). The complete formula will be =COUNTIFS(A2:A100,"A",B2:B100,"Yes")+COUNTIFS(A2:A100,"K",B2:B100,"Yes").

4
Calculate the result

Press Enter to execute the formula and get the combined total count of adults and children who selected Yes.

Use COUNTIFS with Addition
Formula Tip: Adjust the cell ranges (A2:A100 and B2:B100) to match the actual row numbers of your dataset before pressing Enter.
Efficient Data Analysis

Analyze Data Quickly with WPS Spreadsheet

WPS Spreadsheet fully supports advanced logical formulas like COUNTIFS, SUMIFS, and array constants, making it easy to process complex survey responses and demographic datasets.

  1. 1. Open your dataset: Launch WPS Spreadsheet and open the file containing your survey or category data.
  2. 2. Select an output cell: Click on an empty cell to place your calculation result.
  3. 3. Input the COUNTIFS formula: Type your =COUNTIFS combination formula to evaluate your category and response columns.
  4. 4. Get the result: Press Enter to instantly process the data and display your total count.
100% compatible with Microsoft Excel formulas, functions, and formattingProcess large datasets quickly with lightweight performanceIncludes built-in templates for data tracking and demographic surveysCompletely free to use for daily office tasks on multiple platforms
microsoft office alternative - wps office

Frequently Asked Questions

Why is my COUNTIFS formula returning a #VALUE! error?

A #VALUE! error in COUNTIFS usually occurs when the ranges you are comparing are not the exact same size. Ensure that both your category range (e.g., A2:A100) and response range (e.g., B2:B100) have the same number of rows.

Can I count cells that do not equal 'Yes'?

Yes. To count responses that are not 'Yes', use the not equal operator '<>' in your formula. Change the criteria from "Yes" to "<>Yes".

Does this formula work if my cells contain extra spaces?

Extra spaces (like 'Yes ' instead of 'Yes') will cause the formula to skip those cells, returning an inaccurate count. You can use the TRIM function on your data column to remove extra spaces, or use wildcard characters like "*Yes*" in the formula.

How do I count data located on a different worksheet?

You can reference ranges on other sheets by adding the sheet name followed by an exclamation mark before the range. For example, use Sheet2!A2:A100 as your range in the COUNTIFS formula.