Fix Excel IF and AND Formulas Returning the Wrong Result
Question details
Determine why an IF and AND formula returns No when two referenced cells appear to contain TRUE.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A user wants to return Rendabel when cells L137 and M264 are both TRUE, and No otherwise.
- Observed behavior
- The formula returns No even though both cells appear to show TRUE.
Check that L137 and M264 are the cells you intend to compare. Use ISLOGICAL on each cell to determine whether its value is a Boolean TRUE or text that only looks like TRUE.
Compare Boolean TRUE without quotation marks
Use this approach when both referenced cells contain real Boolean values.
In empty cells, enter =ISLOGICAL(L137) and =ISLOGICAL(M264). Each test should return TRUE if the corresponding value is Boolean.
Select the result cell and enter =IF(AND(L137=TRUE,M264=TRUE),"Rendabel","No"). Do not put quotation marks around the Boolean value TRUE.
Press Enter. The formula returns Rendabel when both referenced cells are TRUE; otherwise, it returns No.

Convert text values to Boolean values
Use this approach if ISLOGICAL returns FALSE for a cell that displays TRUE.
Check IF and AND Boolean values in WPS Spreadsheets
Open your workbook in WPS Spreadsheets, check whether the inputs are Boolean values, and correct the IF and AND formula.
- 1. Open the workbook: Open WPS Spreadsheets and choose Open to select your Excel workbook.
- 2. Check the inputs: In empty cells, enter =ISLOGICAL(L137) and =ISLOGICAL(M264) to check whether the referenced values are Boolean.
- 3. Enter the corrected formula: Select the result cell and enter =IF(AND(L137=TRUE,M264=TRUE),"Rendabel","No"). Press Enter to calculate the result.
- 4. Save the workbook: Choose Menu > Save As and select an Excel workbook format if you need to share the file with Excel users.

Frequently Asked Questions
Why does my formula return No when both cells show TRUE?
The cells may contain Boolean TRUE while the formula compares them with the text "TRUE", or the cells may contain text instead of Boolean values. Enter =ISLOGICAL(L137) and =ISLOGICAL(M264) in empty cells to check.
Should I put quotation marks around TRUE in an Excel formula?
Use TRUE without quotation marks for a Boolean value. Use "TRUE" only when you intend to compare against text.
Can I use AND without comparing each cell to TRUE?
Yes. If L137 and M264 contain Boolean values, =IF(AND(L137,M264),"Rendabel","No") returns Rendabel only when both are TRUE.
What if the referenced cells contain formulas that return text?
Select each source cell and check its formula in the formula bar. Change a text result such as "TRUE" to the Boolean value TRUE if the value is meant to be logical.




