Problem using IF and AND together in same formula

Surreybloke

Board Regular
Joined
Apr 1, 2010
Messages
164
Office Version
  1. 365
Platform
  1. Windows
Excel%2012.04.17.jpg


Hi,

I hope the image above isn't too small. The browser crashed when I tried pasting the section of Excel directly.

You will see above that there are two different formulae - one that is simply asking the commissionable value column to return the lowest number between columns B and D, and to then add the value in column C. The formulae in cell A7 is trying to improve on this by asking for the value which is lowest and where the quantity is more than 1.

The reason why I need the lowest value (unless the quantity is more than 1) is because some of the totals are annualized where the contract length is greater than 12 months which produces a lower value than the contract item value and sometimes the contract length is less than 12 months which means I need to return the contract item value. This changes though if the quantity is more than 1. If that is the case, then the contract item value would always be brought through.

I'm hoping someone can help me with the correct formula so that it performs in the intended way.

Many thanks!
 
If I change the formula to =IF(AND(B10>=D10,E10>1),B10,D10)+C10 by flipping around the parts of the formula marked in red, it brings through the lowest value, but won't bring through the higher value when the quantity is more than 1.

In layman's terms, what I need it to do is if the quantity is 1, and the annualized value is lower, bring that through. If the contract item value is lower, bring that through instead. If the quantity is 2 or more, I want it to bring through the higher value, which would be the contract item value. (the annualized value being the 12 month value based on a quantity of 1)
 
Upvote 0

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
with formula as it is now it will return b10 if b10 is greater than d10 AND e10 is greater than 1.
It returns d10 if either or both those conditions are false
 
Upvote 0
What do you think I should amend it to? I've tried a few permutations but haven't hit upon the right combination.
 
Upvote 0
try this and copy down (remove spaces)

Code:
=IF(AND(E2=1,D2 < B2),D2,IF(AND(E2 > =2,D2 > B2),D2,B2))+C2
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,206
Members
453,022
Latest member
RobertV1609

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