logo
search
Formula Errors

How to Use Excel Formulas to Return Values Based on Yes or No Conditions

Nimra MalikNimra Malik Sep 30, 2026 869 views

Question details

The user needs a formula to evaluate multiple columns for a 'Yes' condition and return a corresponding numerical value or text from an adjacent column.

How to Use Excel Formulas to Return Values Based on Yes or No Conditions
Product
Excel
Device & OS
not provided
Scenario
Extracting specific amounts from a dataset by checking alternating columns for 'Yes' or 'No' statuses.
Observed behavior
When the formula is placed in the same column that it attempts to extract data from (such as column L), Excel triggers a circular reference error.
Before you start

Identify the exact columns containing your 'Yes/No' criteria and the columns containing the corresponding return values. Ensure your formula is placed in a completely separate column to prevent circular reference errors.

Solution 1Recommended

Use a Nested IF Formula

A nested IF statement is the most universally compatible way to check multiple columns sequentially for a 'Yes' condition and return the corresponding value.

The IF function checks whether a condition is met, returning one value if true and another if false. By nesting them, you can check multiple columns in order.

1
Select a dedicated result cell

Click on an empty cell in a new column where you want the result to appear. Do not select a cell within the columns you are pulling data from (e.g., if extracting from Column L, use Column M for the formula).

2
Enter the nested IF formula

Type the formula: =IF(B2="Yes",D2,IF(F2="Yes",H2,IF(J2="Yes",L2,""))) into the formula bar. Adjust the cell references based on where your 'Yes/No' conditions and return values are located.

3
Apply the formula down the column

Press Enter to execute the formula. Then, click and drag the fill handle (the small square at the bottom-right of the cell) down to apply this formula to the remaining rows in your dataset.

Use a Nested IF Formula
Avoid Circular References: If your formula evaluates Column J and returns a value from Column L, the formula itself cannot be placed in Column L, as Excel cannot calculate a cell's value based on itself.
Advanced Spreadsheet Tool

Seamlessly Handle Complex Formulas with WPS Spreadsheet

WPS Office offers a powerful Spreadsheet application that fully supports nested IF, XLOOKUP, and other advanced formulas. It includes intuitive error-checking tools to help you identify and resolve circular references instantly.

  1. 1. Open your workbook: Launch WPS Spreadsheet and open your existing data file.
  2. 2. Select a safe output cell: Click a blank cell in a column outside of your referenced data ranges to avoid circular errors.
  3. 3. Apply the conditional formula: Type your nested IF or XLOOKUP formula directly into the formula bar and press Enter.
  4. 4. Use Error Checking: Navigate to the Formulas tab and click 'Error Checking' if you receive any warnings about circular references.
Fully compatible with Microsoft Excel formulas and .xlsx file formats.Intelligent formula suggestions and error-checking to prevent circular references.Lightweight, lightning-fast, and completely free to use for everyday data analysis.
microsoft office alternative - wps office

Frequently Asked Questions

What is a circular reference in Excel?

A circular reference occurs when a formula directly or indirectly refers to its own cell. For example, if you place a formula in cell L2 that includes L2 in its calculation range, Excel gets trapped in an endless calculation loop and throws an error.

Why is my nested IF formula returning an error?

Common causes for nested IF errors include missing double quotation marks around text criteria (like "Yes"), incorrect cell references, or failing to close all parentheses at the end of the formula. Ensure your formula has one closing parenthesis for every IF statement used.

Does XLOOKUP work in older versions of Excel?

No, XLOOKUP is only available in Microsoft 365 and Excel 2021 or newer. If you are using an older version of Excel, you must use the nested IF method or an INDEX and MATCH combination.

How can I return a blank cell instead of 'FALSE' if no 'Yes' is found?

In your nested IF formula, ensure the final argument (value_if_false) is set to an empty string (""). For example, using =IF(B2="Yes",D2,"") tells the program to leave the cell visually empty if the condition is not met.