How do you Combine Two IF formulas

A

Ardy

I am trying to combine =IF((B5*M5)<150,150,(B5*M5)) and =IF((B4*M4)>500.01,500,(B4*M4)). I can't seem to get the syntax correct, or may be it is not supported to do nested IF.
Can somebody help me on this.
 
M

MyVeryOwnSelf

I am trying to combine =IF((B5*M5)<150,150,(B5*M5)) and
=IF((B4*M4)>500.01,500,(B4*M4)).

There are four cases. Think about what result is needed in each case.

(B5*M5)<150 and (B4*M4)>500.01
(B5*M5)<150 and NOT((B4*M4)>500.01)
NOT(B5*M5)<150 and (B4*M4)>500.01
NOT(B5*M5)<150 and NOT(B4*M4)>500.01

OTOH, if the problem is actually all in one row, one way is:
=MAX(150,MIN(B4*M4,500))
 
A

Ardy

The result I am after is in one cell, I need the formula to enter 150.00 if the calculation result is less ten 150.00[=IF((B5*M5)<150,150,(B5*M5))] and enter 500.00 if the calculation is greater than 500.00[=IF((B4*M4)>500.01,500,(B4*M4))]

so the two IF will be in the same cell.
 
M

MyVeryOwnSelf

The result I am after is in one cell, I need the formula to
enter 150.00 if the calculation result is less ten 150.00
[=IF((B5*M5)<150,150,(B5*M5))] and enter 500.00 if the calculation
is greater than 500.00[=IF((B4*M4)>500.01,500,(B4*M4))]

so the two IF will be in the same cell.

The above shows 2 different calculations: the first referencing row 5 and the second referencing row 4. So what does "the" calculation mean?

I'm guessing that the intent is to refer to the same row; that is, the same calculation is compared with both 150 and 500. If that's right -- while it's possible to write nested IF's -- it's more straightforward to use this, in my opinion:
=MAX(150,MIN(B4*M4,500))
 
A

Ardy

I am trying to combine =IF((B5*M5)<150,150,(B5*M5)) and =IF((B4*M4)>500.01,500,(B4*M4)). I can't seem to get the syntax correct, or may be it is not supported to do nested IF.

Can somebody help me on this.

my mistake, your assumption is correct, the min and max did the trick.......
Thanks.......
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top