AND OR

rhmkrmi

Active Member
Joined
Aug 17, 2012
Messages
308
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.
 

Some videos you may like

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
52,960
Office Version
  1. 365
Platform
  1. Windows
Maybe
=COUNTIFS(A10:A100,"Active",B10:B100,"Obsolete")>0
 

rhmkrmi

Active Member
Joined
Aug 17, 2012
Messages
308
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!
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
36,067
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
But that's exactly the same as your existing logic. So what is it that you actually want returned?
 

rhmkrmi

Active Member
Joined
Aug 17, 2012
Messages
308

ADVERTISEMENT

I am sorry, I will put together a sample, you are right, I did not provide the right information!
 

rhmkrmi

Active Member
Joined
Aug 17, 2012
Messages
308
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.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
52,960
Office Version
  1. 365
Platform
  1. Windows
Glad we could help & thanks for the feedback
 

Watch MrExcel Video

Forum statistics

Threads
1,122,588
Messages
5,597,042
Members
414,116
Latest member
sfullnet

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
Top