Combine IF, AND, and OR Logic for Account Status Formulas in Excel
Question details
The user needs to create an Excel formula using nested IF, AND, or OR logic to evaluate "Confirm Disable" and "Process Check" columns to output an "OK" or "Error" status.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Evaluating account statuses based on multiple criteria involving text conditions and boolean values.
- Observed behavior
- The formula needs to accurately return "OK" or "Error" based on logical checks, but errors can occur if boolean TRUE/FALSE values are stored as text instead of logical operators.
Ensure your data is formatted as an Excel Table so structured references like [@[Confirm Disable]] work correctly, and verify whether your TRUE/FALSE values are stored as logical booleans or plain text.
Use Nested IF Functions for Logical Boolean Values
Use this method if your Process Check column contains actual logical TRUE or FALSE values rather than text.
This formula uses a nested IF structure to evaluate the 'Confirm Disable' status first, and then branches to check the logical state of 'Process Check'. It assumes TRUE and FALSE are stored as native boolean values.
Click on the cell in the status column where you want the OK or Error result to appear.
Type the following formula: =IF([@[Confirm Disable]]="Yes",IF([@[Process Check]]=TRUE,"Error","OK"),IF([@[Process Check]]=TRUE,"OK","Error"))
Press Enter to evaluate the formula, then drag the fill handle down to apply it to the rest of the rows in your table.

Use IF and AND Functions for Text Values
Apply this solution if the TRUE and FALSE values in your dataset are stored as plain text.
Master Complex Formulas with WPS Spreadsheet
WPS Spreadsheet offers full compatibility with Microsoft Excel's logical functions, making it easy to build, test, and troubleshoot nested IF, AND, and OR formulas without syntax errors.
- 1. Download and install: Download WPS Office for free and install it on your device.
- 2. Open your dataset: Launch WPS Spreadsheet and open your account status file.
- 3. Input the logical formula: Select the target cell and type your nested IF, AND, or OR formula.
- 4. Verify formula logic: Use the built-in Error Checking and Evaluate Formula tools in the Formulas tab to verify your logic step-by-step.

Frequently Asked Questions
Why does my IF formula return an error even when the logic seems correct?
This often happens due to data type mismatches. For example, the formula might be checking for a logical TRUE value (without quotes), but the target cell contains the word 'TRUE' stored as text. Adding quotation marks around "TRUE" in your formula can fix this issue.
How do I know if TRUE or FALSE is stored as text or a logical value?
By default, logical TRUE/FALSE values are centered in Excel and WPS Spreadsheet, while text values are aligned to the left. You can also use the =ISTEXT(A1) or =ISLOGICAL(A1) functions to accurately identify the data type.
Can I combine IF, AND, and OR in the same Excel formula?
Yes, you can nest AND and OR functions inside the condition argument of an IF statement. For example, =IF(AND(A1="Yes", OR(B1=TRUE, C1=TRUE)), "OK", "Error") allows you to evaluate multiple complex conditions in a single cell.
What is a structured reference in an Excel formula?
A structured reference uses table and column names (like [@[Process Check]]) instead of standard cell addresses (like B2). This makes formulas easier to read and automatically adjusts when rows are added or deleted.




