Forum Discussion
lfox2
Nov 26, 2020Copper Contributor
question
Can I put a minimum and a maximum number, that a cell with a formula, can have?
PeterBartholomew1
Nov 26, 2020Silver Contributor
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
= value*(1+rate)
becomes
= 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))