what is wrong with my AND formula?

pcorpz

Active Member
Joined
Oct 29, 2004
Messages
324
=IF(AND(B3="FALSE",C3="FALSE",D3="FALSE",E3="FALSE",F3="FALSE",G3="FALSE",H3="FALSE",I3="FALSE"),"Valid","Bounced")

My apologies if my formula could have been written a better way.. but basically, I want excel to return Valid if all columns are "FALSE".. and Bounced if one or two more columns have a value other than FALSE.

Some other values would be blank, or unknown_user.. etc.

But the formula only returned "Bounced" so I know I'm missing something...
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
=IF(AND(B3="FALSE",C3="FALSE",D3="FALSE",E3="FALSE",F3="FALSE",G3="FALSE",H3="FALSE",I3="FALSE"),"Valid","Bounced")
I am guessing that the values in B3:I3 are real Booleans (TRUE and/or FALSE, no quote marks), so you would need to remove the quote marks from around the FALSE keywords (real Booleans are not the same as quoted Text strings that look like Booleans). With that said, I think this shorter formula will do what your formula is attempting to do...

=IF(COUNTIF(B3:I3,TRUE),"Bounced","Valid")
 
Last edited:
Upvote 0
=IF(AND(B3="FALSE",C3="FALSE",D3="FALSE",E3="FALSE",F3="FALSE",G3="FALSE",H3="FALSE",I3="FALSE"),"Valid","Bounced")

My apologies if my formula could have been written a better way.. but basically, I want excel to return Valid if all columns are "FALSE".. and Bounced if one or two more columns have a value other than FALSE.

Some other values would be blank, or unknown_user.. etc.

But the formula only returned "Bounced" so I know I'm missing something...

I was doing some tests, and replaced the text "False" to something else, as I thought "False" is also used in excel formula, and that might create a conflict....so I replaced False with No... and my formula worked!!! Weird.!
 
Upvote 0
I was doing some tests, and replaced the text "False" to something else, as I thought "False" is also used in excel formula, and that might create a conflict....so I replaced False with No... and my formula worked!!! Weird.!
See what I wrote in Message #2 about Booleans and quoted Text strings. When you replaced the Boolean values (TRUE and FALSE without quote marks in the cells) with "No" (a quoted Text string), then your test of quoted Text strings with quoted Text strings worked.
 
Upvote 0
I am guessing that the values in B3:I3 are real Booleans (TRUE and/or FALSE, no quote marks), so you would need to remove the quote marks from around the FALSE keywords (real Booleans are not the same as quoted Text strings that look like Booleans). With that said, I think this shorter formula will do what your formula is attempting to do...

=IF(COUNTIF(B3:I3,TRUE),"Bounced","Valid")

Thanks Rick! the values are not real booleans.. since there's more values than true and false? Didn't think of using countif!
 
Upvote 0
See what I wrote in Message #2 about Booleans and quoted Text strings. When you replaced the Boolean values (TRUE and FALSE without quote marks in the cells) with "No" (a quoted Text string), then your test of quoted Text strings with quoted Text strings worked.

Learned something new. =D
 
Upvote 0

Forum statistics

Threads
1,214,402
Messages
6,119,299
Members
448,885
Latest member
LokiSonic

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top