Help with multiple IF / OR / AND statements

kelstar

New Member
Joined
Feb 27, 2011
Messages
11
I need a hand with multiple IF, AND, OR statements.
I am trying to do the following:

1. If AK5 and BF5 are both >= 34%, then take MIN(AK5,BF5).
2. If AK5<34% and BF5>=34%, then take BF5
3. If AK5>=34% and BF5<34%, then take AK5
4. If AK5 and BF5 are both < 34%, then do (G5/EX*MARKUP)+(G5/EX))

I have named a cell MINMARG, value is 0.34.
This is my attempt at the formula

=IF(OR(AK5>=MINMARG,BF5>=MINMARG),MIN(AK5,BF5),IF(OR(AK5<MINMARG,BF5>=MINMARG),BF5,IF(OR(AK5>=MINMARG,BF5<MINMARG),AK5,((G5/EX*MARKUP)+(G5/EX)))))

But it is returning 0. Can't quite figure out where I am going wrong.
Any help would be appreciated.:)
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Try, Untested
Code:
=IF(AND(AK5>=MINMARG,BF5>=MINMARG),MIN(AK5,BF5),IF(AND(AK5<MINMARG,BF5>=MINMARG),BF5,IF(AND(AK5>=MINMARG,BF5<MINMARG),AK5,((G5/EX*MARKUP)+(G5/EX)))))
 
Upvote 0
Thanks Michael,
I should have said I already tried substituting AND for OR, that still returns a zero value.

For some reason I can't get my whole attempt at the formula to post into the thread. Whenever I preview it, parts have been removed.:confused:
 
Upvote 0
Try

=IF(MIN(AK5,BF5)>MINMARG,MIN(AK5,BF5),IF(MAX(AK5,BF5)<=MINMARG,(G5/EX*MARKUP)+(G5/EX),MAX(AK5,BF5)))


With regard to your vanishing formula, in some instances the board interprets < and > as html, you can prevent the problem by putting a single space before and after each < or > , or by wrapping the formula with php tags.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,507
Messages
6,179,181
Members
452,893
Latest member
denay

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