How to Count Yes Values in Nonadjacent Excel Cells
Question details
The user wants to count the number of occurrences of a specific word (such as Yes) across multiple, non-contiguous drop-down cells.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Calculating exact totals from specific drop-down menus that are scattered across non-contiguous cells in a spreadsheet.
- Observed behavior
- A formula is needed to evaluate specific isolated cells (e.g., C7, C9, C11) without inadvertently counting the unrelated cells located between them.
Verify that your drop-down menus are correctly configured and that the target text 'Yes' does not contain hidden trailing spaces, which can cause formula matching errors.
Add Multiple COUNTIF Functions Together
The most straightforward method for a small number of scattered cells is to add individual COUNTIF functions together in a single formula.
Click on the cell where you want the final count to be displayed.
Type the formula: =COUNTIF(C7,"Yes")+COUNTIF(C9,"Yes")+COUNTIF(C11,"Yes"). Replace the cell references with the specific nonadjacent cells you need to evaluate.
Press the Enter key. Excel will evaluate each cell individually and sum the results to give you the total count of 'Yes' values.

Use SUMPRODUCT for Alternating Rows
If your nonadjacent cells follow a strict alternating pattern (e.g., every odd row), SUMPRODUCT is much more efficient for evaluating large data ranges.
Evaluate the Entire Continuous Range
If you are certain that the cells located between your target drop-downs will never contain the word 'Yes', you can safely evaluate the entire continuous range.
Easily Manage Complex Formulas with WPS Spreadsheet
WPS Spreadsheet provides a robust and user-friendly platform for data analysis, offering full support for COUNTIF, SUMPRODUCT, and all standard Excel functions to help you count values across complex data ranges.
- 1. Open your workbook: Launch WPS Spreadsheet and open the document containing your drop-down menus.
- 2. Select an output cell: Click on the specific cell where you want the final Yes count to appear.
- 3. Input the formula: Type your COUNTIF or SUMPRODUCT formula exactly as you would in standard spreadsheet software.
- 4. Execute the calculation: Press Enter to instantly view your precise data count without compatibility issues.

Frequently Asked Questions
Can I use COUNTIF with multiple non-contiguous ranges directly?
No, the standard COUNTIF function in Excel only accepts a single continuous range as its first argument. To evaluate multiple separate ranges, you must either add several COUNTIF functions together or use more advanced array formulas.
Why is my COUNTIF formula returning 0 when I can clearly see 'Yes' in the cells?
This usually happens due to hidden trailing or leading spaces in the target cells (e.g., 'Yes '). You can use the TRIM function to clean your data, or ensure the data validation drop-down list is strictly formatted to eliminate extra spaces.
Is there a way to count cells if they equal 'Yes' or 'No'?
Yes, you can sum two COUNTIF statements together, such as =COUNTIF(C7:C11,"Yes")+COUNTIF(C7:C11,"No"). Alternatively, for continuous ranges, you can use an array formula like =SUM(COUNTIF(C7:C11,{"Yes","No"})).




