'Set a maximum cell value in Google Spreadsheet?

I want to add cells a-d and then do something like add cell (e/22) but not return something greater than 1.0

Ideas?



Solution 1:[1]

 =if(sum(A1:D1)+(E1/22)>1,[INSERT ALTERNATIVE VALUE HERE],sum(A1:D1)+(E1/22))

Solution 2:[2]

For setting a min, wrap your formula with a MAX(original formula; min value) and to set a max limit do MIN(original formula; max value). In the example you gave it wil be MAX(your formula; 0) turning to MAX(-20; 0) which is 0.

To set both boundaries in same cell, do MAX(MIN(original formula; max value); min value).

This is not specific to spreadsheets, it is generic math.

Solution 3:[3]

Set maximum cell value on input(validation)

Data => Data validation Criteria: Number

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ECWyne
Solution 2 From Google
Solution 3 Barna Burom