If AND Formula

Matt_Thompson

Board Regular
Joined
Apr 5, 2004
Messages
101
Hi,

I currently am struggling with a IF(AND(blah blah)) formula.

I have data in col A which is a number of 1 through to 5. This stands for :

1 = uncapped
2 = capped at 200
3 as above
4 as above
5 = 0

What I am trying to do is have a formula which will say:

If Col A = 1, return Col B
if Col A = 2 AND Col B is greater than 200, return 200 else return Col B
if Col A = 3 AND Col B is greater than 200, return 200 else return Col B
if Col A = 4 AND Col B is greater than 200, return 200 else return Col B
if Col A = 5 return 0

So far I can build the individual bits but when I try to put together =IF((AND(A7=4,B7>200),200,A7), if(AND(A7=4,B7>200),200,A7))

It does not like this but I'm not sure what I'm missing but I'm sure it's something stupid what with it being a Friday Afternoon!!

If anyone can point me in the right direction I'd be most grateful,

Cheers,

Matt
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

sgremmo

Board Regular
Joined
Sep 1, 2004
Messages
55
in italian in C1

=SE(A1=1;B1;SE(A1=5;0;SE(E(O(A1=2;A1=3;A1=4);B1>200);200;B1)))

in english probably

=IF(A1=1,B1,IF(A1=5,0,IF(E(O(A1=2,A1=3,A1=4),B1>200),200,B1)))

ciao

Simone
 

NBVC

Well-known Member
Joined
Aug 31, 2005
Messages
5,828
Give this a try:

=IF(A1=5,0,IF(OR(A1=1,B1<200),B1,200))

What if A1 > 5 or = 0 or is blank? What happens?
 

Matt_Thompson

Board Regular
Joined
Apr 5, 2004
Messages
101
Thanks to the people who posted replies.

They worked great and have solved my problem.


thank you so much for your help,

Matt
 

Forum statistics

Threads
1,136,520
Messages
5,676,340
Members
419,619
Latest member
jalme

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