ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   IF, but Not to Exceed (https://www.excelbanter.com/excel-worksheet-functions/217751-if-but-not-exceed.html)

dnamertz

IF, but Not to Exceed
 
Can I add an argument to an IF statement that will result in a calculation,
but not if it exceeds a certain amount? For example, can I have an IF
statement display the result F5-F4, but if F5-F4 exceeds E5 then it will
display E5?

T. Valko

IF, but Not to Exceed
 
Try this:

=MIN(F5-F4,E5)

--
Biff
Microsoft Excel MVP


"dnamertz" wrote in message
...
Can I add an argument to an IF statement that will result in a
calculation,
but not if it exceeds a certain amount? For example, can I have an IF
statement display the result F5-F4, but if F5-F4 exceeds E5 then it will
display E5?




Ron Rosenfeld

IF, but Not to Exceed
 
On Sat, 24 Jan 2009 10:18:00 -0800, dnamertz
wrote:

Can I add an argument to an IF statement that will result in a calculation,
but not if it exceeds a certain amount? For example, can I have an IF
statement display the result F5-F4, but if F5-F4 exceeds E5 then it will
display E5?


something like =max(e5,f5-f4)

--ron

Ron Rosenfeld

IF, but Not to Exceed
 
On Sat, 24 Jan 2009 13:34:27 -0500, Ron Rosenfeld
wrote:

On Sat, 24 Jan 2009 10:18:00 -0800, dnamertz
wrote:

Can I add an argument to an IF statement that will result in a calculation,
but not if it exceeds a certain amount? For example, can I have an IF
statement display the result F5-F4, but if F5-F4 exceeds E5 then it will
display E5?


something like =max(e5,f5-f4)

--ron


Ooops -- that should have been =min(e5,f5-f4)
--ron

Shane Devenshire[_2_]

IF, but Not to Exceed
 
The responses you got were correct for the example you gave, but the general
answer to your question is yes and a general IF solution would read

=IF(Test,Calculation1,Calculation2)
or with your sample:

=IF(F5-F4E5,E5,F5-F4)

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"dnamertz" wrote:

Can I add an argument to an IF statement that will result in a calculation,
but not if it exceeds a certain amount? For example, can I have an IF
statement display the result F5-F4, but if F5-F4 exceeds E5 then it will
display E5?



All times are GMT +1. The time now is 10:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com