11-26-2020 07:00 AM - edited 11-26-2020 07:08 AM
It is not like data validation. If the result of the calculation is a scalar value then the MEDIAN function can be used to place upper and lower bounds of the result returned by the formula. So
= MEDIAN( min, max, value*(1+rate) )
If, like me, you always use array formulas, life become more difficult because the aggregation functions such as MIN, MAX, SUM aggregate entire array rather than value by value. In that case the formula might need to be
= LET( result, array*(1+rate), IFS(result>max, max, result<min, min, 1, result))
11-26-2020 02:25 PM - edited 11-26-2020 02:26 PM
@lfox2 Learning to provide concrete examples will go a long way toward getting applicable answers.
Suppose the original formula is =SUM(A1:A100), and you want the result to be no less than 10 and no more than 100. You could write:
=MAX(10, MIN(100, SUM(A1:A100))
11-26-2020 04:27 PM
You may apply Custom Data validation to the cell or range where you want to create the formula with upper and lower limits. To do that,
Select the destination range
Go to the Data Tab and click on data Validation (Shortcut is Alt , D ,L)
Under "Allow" select ► "Custom"
Under Data ► Select Between
Type the Min and Max values and hit OK
If the result of the function violates the Upper or lower limit ► you get an error message.
Please Note that You cannot create a Formula/ Function in a cell then copy it because copying overwrites the Data Validation.
You can create a very simple code to prevent overwriting the Data validation, here is a link:
Hope that helps