Keep amounts between set limits

Turn 640.25 into 500 when the limits are 25 to 500, and flag limits in the wrong order.

What you'll make

In Excel: 640.25 with limits 25 to 500 becomes 500.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1B8>C8Checks if the lower limit is above the upper one.FALSE
2"Review amount bounds"The message shown when the limits are the wrong way round.Not used for row 8
3MAX(B8,A8)The bigger of the amount and the lower limit.640.25
4MIN(C8, … )The smaller of that and the upper limit.500
5IF( … )Shows part 2 when part 1 is TRUE, otherwise part 4.500

Read it left to right. MIN wraps part 3, and IF wraps everything, so it works last. The amounts are made-up.

=IF(B8>C8,"Review amount bounds",MIN(C8,MAX(B8,A8)))

How to use it

Yellow bar at the top? Click Enable Editing.

  1. See it work. The Example tab shows 20 made-up examples with the formula already in.
  2. Use your own amounts. Paste amounts and each row's lower and upper limits into the green columns of the Template tab. The results fill in by themselves.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

Use only limits your policy actually sets. Amounts outside them are changed, so keep the originals too.

Microsoft's help: MIN function