Function Problems

How to Automatically Display Yes or No Based on an Excel Value

Huda QurayshiHuda Qurayshi Nov 2, 2026 869 views

Question details

The user needs an automated way to evaluate a numeric value in one column and output 'Yes' if the value is between 0 and 2, and 'No' if the value is greater than 2 in a different column.

How to Automatically Display Yes or No Based on an Excel Value
Product
Excel
Device & OS
not provided
Scenario
Evaluating numeric thresholds in a dataset and assigning text labels ('Yes' or 'No') to categorize the results.
Observed behavior
A formula is needed for Column R to dynamically output 'Yes' or 'No' depending on whether the corresponding numerical value in Column M falls within the 0 to 2 range.
Before you start

Verify that your source column contains numerical values rather than text strings, and determine the exact starting row of your dataset to ensure your cell references align correctly.

Solution 1Recommended

Use a Standard IF Function

Apply Excel's standard IF function to quickly test a numerical threshold and return one text value if the condition is met, and another if it is not.

The IF function is the most efficient way to generate automatic text labels based on a logical test. By checking if the number is greater than 2, the formula handles the specified range logically.

1
Select the target cell

Click on the first cell in your output column where you want the 'Yes' or 'No' to appear (for example, cell R3).

2
Enter the IF formula

Type the formula `=IF(M3>2, "No", "Yes")` into the formula bar. This checks if the value in cell M3 is strictly greater than 2. If it is, the cell displays 'No'; otherwise, it displays 'Yes'.

3
Apply the formula

Press the Enter key to execute the formula. You should now see either 'Yes' or 'No' based on the value in M3.

4
Copy the formula down the column

Hover your cursor over the bottom-right corner of cell R3 until it turns into a solid black plus sign (the fill handle). Click and drag it down the column to apply the formula to the remaining rows.

Text Requires Quotes: Always remember to enclose text labels like "Yes" and "No" in double quotation marks within your formula, otherwise Excel will return an error.
Efficient Spreadsheet Data Management

Easily Apply Logical Formulas with WPS Spreadsheet

WPS Spreadsheet fully supports standard IF, AND, and other logical functions, allowing you to seamlessly process data and automate outputs. It provides an intuitive interface for writing and managing complex formulas.

  1. 1. Open your file in WPS: Launch WPS Spreadsheet and open your existing data file.
  2. 2. Select the target cell: Click on the destination cell where the 'Yes' or 'No' output should be generated.
  3. 3. Utilize formula prompts: Start typing `=IF(` and use the built-in syntax tooltip to guide you as you type your condition and desired text outputs.
  4. 4. Auto-fill the column: Press Enter, then double-click the fill handle to populate the entire column instantly.
Fully compatible with Microsoft Excel formulas and .xlsx files.Intuitive formula bar with helpful syntax prompts for functions like IF.Lightweight, fast, and completely free to use for core spreadsheet tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Can I use 'True' or 'False' instead of 'Yes' or 'No'?

Yes. To output logical TRUE or FALSE, you can simply write the logical expression like `=M3<=2`, or use `=IF(M3>2, FALSE, TRUE)`. Do not put quotation marks around TRUE or FALSE so the spreadsheet recognizes them as native logical values rather than text.

Why is my IF formula showing a #NAME? error?

A #NAME? error usually occurs if there is a typo in the function name (e.g., spelling it FI instead of IF) or if you forgot to put double quotation marks around your text values (like "Yes"). Ensure your formula exactly matches `=IF(M3>2, "No", "Yes")`.

How do I return a blank cell instead of 'No'?

If you only want to display 'Yes' when the condition is met and leave the cell blank otherwise, use a set of empty quotation marks for the false condition: `=IF(M3<=2, "Yes", "")`.

Can I automatically color the cells that say 'Yes'?

Yes, after applying your IF formula, select the output column, go to the Home tab, and click 'Conditional Formatting'. Choose 'Highlight Cells Rules' > 'Equal To', type 'Yes', and select your preferred highlight color.