# Condition not working in nested IF



## 2022 (Jan 6, 2023)

Hi, does anyone know why this part * IF(BR35="TRUE","Unique Data" * of the formula below would not work properly, if the first 3 conditions are NOT true, but the 4th condition is true? 

=IF(A35="","",IF(AND($A$1="NO",L35=BY35),"X",IF(AND($A$1="NO",L35=CA35),"Y",IF(BR35="TRUE","Unique Data",IF(BP35="TRUE","Code ",IF(AND(BR35="FALSE",BP35="FALSE",BT35="TRUE"),"Other",""))))))

ie 
=IF(A35="","",
IF(AND($A$1="NO",L35=BY35),"X", and
IF(AND($A$1="NO",L35=CA35),"Y"

are NOT true

but

IF(BR35="TRUE","Unique Data"

is true because, the text in cell BR35 is "TRUE".....so the formula should return the text "Unique data"


----------



## DanteAmor (Jan 7, 2023)

In cell BR35 do you have TRUE without quotes or do you have "TRUE" with quotes?
If you have TRUE without quotes, then in the formula you must put it without quotes, same for FALSE.
In the cell TRUE AND FALSE are functions that is why they go without quotes, if you put them in quotes in the formula it means that you are referring to the text "TRUE"

Dante AmorABCKLMBOBPBQBRBSBTBUBVBWBXBYBZCA13233Unique Data3435vTRUEbnHoja3Cell FormulasRangeFormulaB33B33=IF(A35="","",
IF(AND($A$1="NO",L35=BY35),"X",IF(AND($A$1="NO",L35=CA35),"Y",
IF(BR35=TRUE,"Unique Data",IF(BP35=TRUE,"Code ",
IF(AND(BR35=FALSE,BP35=FALSE,BT35=TRUE),"Other",""))))))


----------



## 2022 (Monday at 7:11 AM)

Hi Dante, thanks for the insight. They are functions rather than text. I tried to amend the formula, so that it looks at the text without the quotes, but it didn't work. However, I'll keep on digging. Your insight is helpful, though!


----------



## Fluff (Monday at 7:18 AM)

Can you post some sample data.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.


----------

