Reputation: 437
=IF(SUM(B12-B10)<0,0,SUM(B12-B10))
=IF(SUM(B12-B10)>3270,3270,SUM(B12-B10))
I am trying to write an excel formula that will not allow the cell's value to go below 0 or above 3270. I have the two formulas above but I am not sure how to get them both into once cell.
Does anyone know how to do this?
Upvotes: 0
Views: 47
Reputation: 96753
You don't need the SUM() function:
=IF(B12-B10<0,0,IF(B12-B10>3270,3270,B12-B10))
Upvotes: 2
Reputation: 187
This should work:
=IF(SUM(B12-B10)<0,0,IF(SUM(B12-B10)>3270,3270,SUM(B12-B10)))
Cheers
Upvotes: 1
Reputation: 13463
You put the second IF statement in the False of the First IF statement.
=IF(SUM(B12-B10)<0,0,IF(SUM(B12-B10)>3270,3270,SUM(B12-B10)))
Upvotes: 2