Excel Formula: Return Result When Exactly One Cell Has a Number
Question details
The user needs an Excel formula to evaluate a non-contiguous list of cells and return a specific value only if exactly one cell contains a numeric value. Blank cells or multiple numeric cells should return no result or an alternative value.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Calculating a specific score or returning a condition-based result depending on the presence of a single numeric entry across scattered cells.
- Observed behavior
- The formula needs to output a custom score (like 1) when the count of numbers equals 1, and return a blank string or alternative score when the condition is not met.
Identify all the specific non-adjacent cells you need to check, and determine the exact score or text you want to return when the condition is met.
Use IF and COUNT Functions for Non-Contiguous Cells
Combine the IF function with the COUNT function to evaluate specific cells and return a value if exactly one number is found.
The COUNT function is designed to tally the number of cells that contain numbers. By wrapping it in an IF statement, you can set a strict equality test to return a specific result if the count is exactly 1.
Click on the cell where you want the formula's result to appear.
Type =IF(COUNT(D21, G21, I21, K21)=1, 1, "") into the formula bar, substituting the example cell references with your own cells separated by commas.
Change the '1' to whatever result score you need, and replace '""' with your preferred alternative result (like 0) if the condition is not met.
Press the Enter key to calculate and display the result.

Use WPS Spreadsheet for Complex Conditional Formulas
WPS Spreadsheet fully supports advanced logical functions like IF and COUNT. You can easily apply these formulas across multiple cells and worksheets to streamline your data analysis, all within a familiar interface.
- 1. Open your workbook: Launch WPS Spreadsheet and open the document containing your data.
- 2. Select the target cell: Click on the cell where you want the formula result to appear.
- 3. Input the IF and COUNT formula: Type =IF(COUNT(A1, C1, E1)=1, 1, "") replacing the cell references with your own non-contiguous range.
- 4. Execute the formula: Press Enter to view the calculation result instantly.

Frequently Asked Questions
How do I check if exactly one cell has text instead of a number?
If your cells contain text, use the COUNTA function instead of COUNT. COUNTA tallies all non-empty cells regardless of data type. For example: =IF(COUNTA(A1, B1, C1)=1, "One entry", "None or multiple").
Can I use a continuous range instead of separating cells with commas?
Yes. If the cells you want to check are next to each other, you can use a colon to define the range. For example: =IF(COUNT(A1:A10)=1, 1, 0).
What if I want the formula to return a result when more than two numbers are present?
You can change the logical test operator in the IF statement. Instead of '=1', use '>2' (greater than two). The formula would look like this: =IF(COUNT(A1, C1, E1, G1)>2, 1, "").




