honkin

Active Member
Joined
Mar 20, 2012
Messages
374
Office Version
  1. 2016
Platform
  1. MacOS
hi

I am trying to get a particular result, but I have obviously got the syntax slightly wrong in my formula and I wonder if someone might look at it and indicate where I went wrong.

Here is the formula:-

Code:
=IF(AND(Q2="L",P2<=2.2,OR(Q2="P",P2<=2.2)),95,IF(AND(Q2="W",P2<=2.2),-100*P2+100,0))

In a nutshell I want to see if cell Q2 has either "P" or "L" in it and P2 <=2.20 then the result is 95. If Q2 has "W" in it and P2 is <=2.20, then this calculation is performed -100*P2+100

I get the correct result if "L" or "W" are in Q2, but if it is a "P", the result is always showing up as 0, even if P2 is <=2.20.

Any idea what needs correcting to make the formula achieve the desired result?

Thanks in advance
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Try this

=IF(AND(OR(Q2={"L","P"}),P2<=2.2),95,IF(AND(Q2="W",P2<=2.2),-100*P2+100,0))

Or this


=IF(P2<=2.2,IF(OR(Q2={"L","P"}),95,IF(Q2="W",-100*P2+100,0)),0)
 
Last edited:
Upvote 0
Try this

=IF(AND(OR(Q2={"L","P"}),P2<=2.2),95,IF(AND(Q2="W",P2<=2.2),-100*P2+100,0))

Or this


=IF(P2<=2.2,IF(OR(Q2={"L","P"}),95,IF(Q2="W",-100*P2+100,0)),0)

Thanks so much DanteAmor. They both seem to give the right result, so I can opt for either.

Thanks again
 
Upvote 0
I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,792
Messages
6,121,612
Members
449,038
Latest member
apwr

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