AND OR

rhmkrmi

Active Member
Joined
Aug 17, 2012
Messages
341
Office Version
  1. 365
Platform
  1. Windows
Hello,

Is there a better way to write this formula?
This is a sample but it should check over 100 rows and I am going to use it for a message in an if statement in cell A2 if TRUE:

=A2=OR(AND(A10="Active",B10="Obsolete"),AND(A11="Active",B11="Obsolete"),AND(A12="Active",B12="Obsolete"),AND(A13="Active",B13="Obsolete"))

Thank you.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Maybe
=COUNTIFS(A10:A100,"Active",B10:B100,"Obsolete")>0
 
Upvote 0
Thanks.

In column B, I can have other values than "Obsolete".
For example, "Active" in A10 and "Current Year" in B10 are valid but "Active" in A11 and "Obsolete" in B11 are invalid.

If I use the COUNTIF (which I have tired before), the result will be TRUE but it actually is not because only row 11 is incorrect!
 
Upvote 0
But that's exactly the same as your existing logic. So what is it that you actually want returned?
 
Upvote 0
I am sorry, I will put together a sample, you are right, I did not provide the right information!
 
Upvote 0
The formula that Fluff has provided is fine, I had a misunderstanding about some of the values that I am using.
Thanks very much for your kind co-op.
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,695
Members
448,979
Latest member
DET4492

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