How to Fix an Excel IF Formula Returning Only One Result
Question details
The user needs to correct an IF formula that incorrectly returns the same single result for all rows, specifically requiring it to output 'YES' when both 'Elected' and 'Finance Certified' columns contain 'YES', and 'NO' otherwise.

- Product
- Spreadsheet
- Device & OS
- not provided
- Scenario
- Evaluating multiple conditions across different table columns to return a specific text string using the IF function.
- Observed behavior
- The current IF formula is failing to evaluate both conditions correctly, resulting in an output of only one result regardless of the actual data in the referenced columns.
Verify that your data range is formatted as a Table (Insert > Table) if you plan to use structured references like [@ColumnName]. Ensure there are no hidden trailing spaces in your cells containing 'YES', as this will cause the exact match condition to fail.
Combine the IF and AND Functions (Structured References)
Use the AND function within your IF logical test to require both column conditions to be met simultaneously in an Excel table.
The standard IF function evaluates a single logical test. When you need multiple conditions to all be true, nesting the AND function inside the IF function allows you to test them together. Because the data is inside a Table, structured references are used to point to the specific columns.
Click on the cell in your table where you want the YES or NO result to appear.
Type the formula: =IF(AND([@Elected]="YES", [@[Finance Certified]]="YES"), "YES", "NO").
Press Enter. Since this is an Excel table, the formula will automatically fill down the entire column, accurately evaluating each row.

Use Standard Cell References for Normal Ranges
If your data is formatted as a normal range rather than an official Table, apply standard cell references combined with the IF and AND functions.
Use WPS Spreadsheet to Build and Troubleshoot Complex Formulas
WPS Spreadsheet offers a robust calculation engine with built-in formula prompts and color-coded cell references, making it incredibly easy to write, nest, and troubleshoot functions like IF and AND.
- 1. Open your workbook: Launch WPS Spreadsheet and open the document containing your data.
- 2. Start typing the formula: Select your target cell and type =IF(AND( to trigger the formula hint assistant.
- 3. Select referenced cells visually: Click the 'Elected' cell, type ="YES",, then click the 'Finance Certified' cell and type ="YES"), "YES", "NO").
- 4. Calculate and fill: Press Enter to execute the formula, then double-click the fill handle to populate the entire column.

Frequently Asked Questions
Why is my IF formula returning 'NO' even when both cells say 'YES'?
This usually happens due to hidden trailing spaces in your data (e.g., 'YES ' instead of 'YES'). Because the match must be exact, extra spaces cause the AND logic to fail. You can use the TRIM function or the Find and Replace tool to remove unwanted spaces.
Can I use the IF function with more than two conditions?
Yes, you can include up to 255 conditions inside the AND function. For example: =IF(AND(A2="YES", B2="YES", C2="YES"), "YES", "NO"). The formula will only return 'YES' if every single condition separated by a comma is met.
What if I want to return 'YES' if either of the columns is 'YES'?
If you only need at least one condition to be true, replace the AND function with the OR function. The formula would look like this: =IF(OR([@Elected]="YES", [@[Finance Certified]]="YES"), "YES", "NO").
What does the @ symbol mean in my Excel formula?
The @ symbol signifies a structured reference, meaning the formula is pointing to data in the current row of the specified Table column. It is an automatic feature of Excel Tables that replaces the need to type exact row numbers.




