How do I do an if and formula with a minimum for each if/and statement?

mrome86

New Member
Joined
Apr 19, 2023
Messages
3
Office Version
  1. 365
Platform
  1. Windows
=IF(D12<495,D12,IF(AND(D12>495,D12<=750),D12-(D12*0.08),IF(AND(D12>750,L4<=8000),(D12-(D12*0.15)))))

In the above formula how do I make it so in the between 495 and 750 section the result can't be lower than 495 and in the 750 to 8000 section the result can't be lower than 750.

I want to lower the amount during each section but I don't want the result to be lower than 495 in that section or lower than 750 in that section.

Hopefully that makes sense. I want to do a nested IF function where each section can't result in lower than my minimum amount for each section.

Thank you
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
the IF works left to right
so in the first test
=IF(D12<495,D12,
its lower than 495
so cannot be lower than 495 in any of the next nested IFs

=IF(D12<495,D12,IF(D12<=750,D12-(D12*0.08),IF(L4<=8000),(D12-(D12*0.15)))))
and so in the last statement D12 cannot be less than 750

you dont have a FALSE statement
=IF(D12<495,D12,IF(D12<=750,D12-(D12*0.08),IF(L4<=8000,(D12-(D12*0.15)))))

so if L4 is greater than 8000 - what happens
 
Upvote 0
Hi & welcome to MrExcel.
How about
Excel Formula:
=IF(D12<=495,D12,IF(D12<=750,MAX(495,D12-(D12*0.08)),IF(D12<=8000,MAX(750,D12-(D12*0.15)))))

I assumed the L4 reference was a typo
 
Upvote 0
Yes the L4 was a typo.

In the second check when I multiply it by .08 it could end up lower than 495 if the number is 496 to 538. If it is 539 then 8% less is above 495. There is a range after 750 where this is also true. I just want to make sure when I take the percentage off the result can't be lower than the last number.

I'm doing a cost per miles. So at so many miles cost is this and so on. I don't want one distance to be 495 and then a longer distance to be less than 495 because of the discount. I want to keep it at 495 until taking 8% off the number is higher than 495.

Sorry if I'm explaining this poorly. My brain is fried from failing at this all mornin.g
 
Upvote 0
Did you try the formula I suggested?
 
Upvote 0
I misread your formula haha. Yes your formula works exactly like I wanted. I was just coming back to say I couldn't read and you were right.

Thank you so much. Saved my morning.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,330
Messages
6,124,308
Members
449,151
Latest member
JOOJ

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