Solved

how to simplify this IF OR AND functions

Posted on 2016-10-06
9
63 Views
Last Modified: 2016-10-06
i have this long formula.

=IF(OR(AND(A2=1,B2=9),AND(A2=2,B2=12),AND(A2=3,B2=18),AND(A2=4,B2=15),AND(A2=5,B2=22),AND(A2=6,B2=95),AND(A2=12,B2=19),AND(A2=42,B2=52)),"","Ok")

is there any easy way or more simplistic way to achieve the same without these too many ORs and ANDs ? or make it work in a better way.
0
Comment
Question by:excelismagic
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 31

Assisted Solution

by:Subodh Tiwari (Neeraj)
Subodh Tiwari (Neeraj) earned 100 total points
ID: 41831503
One way....

=IF(ISNUMBER(MATCH(A2&B2,{"19","212","318","415","522","695","1219","4252"},0)),"","OK")

Open in new window

0
 
LVL 52

Accepted Solution

by:
Rgonzo1971 earned 400 total points
ID: 41831509
Hi,

pls try
=IF(MAX((A2={1,2,3,4,5,6,12,42})+(B2={9,12,18,15,22,95,19,52}))=2,"","Ok")

Open in new window

Regards
3
 
LVL 31

Assisted Solution

by:Subodh Tiwari (Neeraj)
Subodh Tiwari (Neeraj) earned 100 total points
ID: 41831515
Rgonzo's formula can be simplified as below...

=IF(MAX((A2={1,2,3,4,5,6,12,42})*(B2={9,12,18,15,22,95,19,52})),"","Ok")

Open in new window

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 31

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41831519
@Rgonzo
Good catch. Thanks for the information. :)
0
 
LVL 3

Author Closing Comment

by:excelismagic
ID: 41831546
WOW Rgonzo

I am really impressed.
1
 
LVL 26

Expert Comment

by:ProfessorJimJam
ID: 41831550
+1  Rgonzo1971
0
 
LVL 31

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41831560
Tweaked formula.....

=IF(ISNUMBER(MATCH(A2&" "&B2,{"1 9","2 12","3 18","4 15","5 22","6 95","12 19","42 52"},0)),"","OK")

Open in new window

0
 
LVL 3

Author Comment

by:excelismagic
ID: 41831602
thanks Neeraj
0
 
LVL 31

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41831606
You're welcome!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question