IF OR AND function

Hi
I would like help with placing brackets in right place and any other help on the below formula.
Example  ....... COL D contains numbers 1-12 and only numbers = 2,3 and 5 are of interest,
IF(OR(AND(D2=2,D2=3,D2=5),E2=1,F2=4,G2=5),99,0)
sample
                      D2 value = 2     E2 value = 1    F2 value = 4    G2  value = 5      returned value  = 99  all conditions fulfilled
                      D2 value = 1     E2 value = 1    F2 value = 4    G2  value = 5      returned value  = 0
                      D2 value = 2     E2 value = 4    F2 value = 4    G2  value = 5      returned value  = 0
                      D2 value = 3     E2 value = 1    F2 value = 4    G2  value = 5      returned value  = 99  all conditions fulfilled

Please help by modifying formula
Thanks
Ian
Ian BellretiredAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

aikimarkCommented:
IF(AND(OR(D2=2,D2=3,D2=5),AND(E2=1,F2=4,G2=5)),99,0)

Open in new window

updated
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
You've just reversed AND and OR:
IF(AND(OR(D2=2,D2=3,D2=5),E2=1,F2=4,G2=5),99,0)

Open in new window

1
Ian BellretiredAuthor Commented:
Thanks guys you were quick.
Works perfectly
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Ian BellretiredAuthor Commented:
It's worked perfectly at my end.
I ran it over 72,000 rows and carried out an independent check and it all matched.
Thanks
0
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
Sorry.
aikimark changed his comment several times while I was looking at it (but not having posted yet), and I had the original comment in view only.
The comment as posted works. Whether you prefer his or my formula is up to you - please reassign points as you see fit.
1
Ian BellretiredAuthor Commented:
I wasn't aware of that. When I first accessed to see replies Aikimark's answer was complete.
I awarded the points based on his being first on list. However due to your latest post it probably is fair to award points equally. Assuming of course Aikimark has no objection.

Thanks again chaps

Ian
0
aikimarkCommented:
No objection.  I thought I had made my change quick enough.  I guess that was a bad assumption on my part.  Sorry for the confusion.
0
Ian BellretiredAuthor Commented:
I can now sleep peacefully :)   thanks A
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.