How to Use Excel Formulas to Return Values Based on Yes or No Conditions
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.

- 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.
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.
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.
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).
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.
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 the XLOOKUP Function
For modern versions of Excel, XLOOKUP provides a cleaner and more flexible approach to finding the first 'Yes' and returning its corresponding value.
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. Open your workbook: Launch WPS Spreadsheet and open your existing data file.
- 2. Select a safe output cell: Click a blank cell in a column outside of your referenced data ranges to avoid circular errors.
- 3. Apply the conditional formula: Type your nested IF or XLOOKUP formula directly into the formula bar and press Enter.
- 4. Use Error Checking: Navigate to the Formulas tab and click 'Error Checking' if you receive any warnings about circular references.

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.




