ff0000e2
ff0000e2

Reputation: 437

limiting a cell to two numbers

=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

Answers (3)

Gary&#39;s Student
Gary&#39;s Student

Reputation: 96753

You don't need the SUM() function:

=IF(B12-B10<0,0,IF(B12-B10>3270,3270,B12-B10))

Upvotes: 2

BasicIsaac
BasicIsaac

Reputation: 187

This should work:

=IF(SUM(B12-B10)<0,0,IF(SUM(B12-B10)>3270,3270,SUM(B12-B10)))

Cheers

Upvotes: 1

HAL9256
HAL9256

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

Related Questions