Sub topic 8
Floors and Caps in Practice
This chapter assumes you can copy formulas across a row, anchor references with $, and read a forecast layout with periods in columns. It also assumes you know what MIN and MAX return and that either can stand in for a simple IF. Here you use them as floors and caps on real model lines, and you learn the errors that appear when you do.
The working model
A floor is a lower limit. A value may rise above it, but it never falls below it. MAX creates a floor, because it returns the larger of its arguments.
A cap is an upper limit. A value may fall below it, but it never rises above it. MIN creates a cap, because it returns the smaller of its arguments.
The names look reversed at first, so use this rule:
MAX(x, floor)can never return less thanfloor.MIN(x, cap)can never return more thancap.
| Goal | Formula pattern | Example result |
|---|---|---|
| Never below zero | `=MAX(0, x)` | x = -50 gives 0 |
| Never below a minimum | `=MAX(x, minimum)` | x = 80, minimum = 100 gives 100 |
| Never above a maximum | `=MIN(x, maximum)` | x = 80, maximum = 60 gives 60 |
| Between two limits | `=MIN(maximum, MAX(minimum, x))` | x = 130, limits 100 and 120 gives 120 |
The order of nesting matters when both limits apply. Put the floor inside and the cap outside, as in the last table row. If the minimum is ever larger than the maximum, the outer MIN wins and the result equals the maximum. Make sure your inputs cannot cross.
Why use limits instead of IF
You can write every floor and cap as an IF. These two formulas return the same number:
=IF(F30>0,F30,0)
=MAX(0,F30)The MAX version has one reference to F30 instead of two. It is shorter, so there is less to audit, and nobody has to check that both branches point at the same cell. Use IF when the logic has a real condition or needs different calculations in each branch. Use MIN and MAX when you are only limiting a number.
A capped bonus
The topic's cap example calculates a bonus as a percentage of a base amount but never lets it exceed a maximum:
=MIN(F20*$C$3,$C$4)Here F20 is the base amount, $C$3 is the bonus percentage input, and $C$4 is the maximum bonus. The inputs sit in cells with labels, not inside the formula. If you wrote =MIN(F20*0.1,5000), a reviewer could not see the 10% or the 5,000 without opening the cell, and nobody could change them in one place.
Walk through three periods with a 10% rate and a 5,000 cap:
| Period | Base (F20) | 10% of base | Bonus after cap |
|---|---|---|---|
| 1 | 30,000 | 3,000 | 3,000 |
| 2 | 50,000 | 5,000 | 5,000 |
| 3 | 80,000 | 8,000 | 5,000 |
In period 3 the cap binds. A limit binds when it changes the result, meaning the unlimited value would have been different. Knowing when a limit binds is central to auditing, and the section on checks below shows how to make it visible.
A floor on tax
Tax is the standard floor example. If pre-tax income is negative, the model should not produce a negative tax charge, which would behave like a refund the company has not earned. The simple version is:
=MAX(0,F30)*$C$5F30 is pre-tax income and $C$5 is the tax rate. The floor applies to income before the rate is multiplied. A loss gives MAX(0,-200) = 0, and 0 times the rate is 0.
The next table shows a 25% rate over four periods:
| Period | Pre-tax income | Taxable amount | Tax |
|---|---|---|---|
| 1 | 400 | 400 | 100 |
| 2 | -200 | 0 | 0 |
| 3 | 300 | 300 | 75 |
| 4 | 500 | 500 | 125 |
This formula is deliberately simple. It treats each period on its own, so the period 2 loss is lost for tax purposes. Real tax rules often let a company carry a loss forward and use it against later profit. That needs a separate loss balance with its own opening, additions, usage, and closing rows. The MAX(0, ...) floor is still the first building block, but the simple form is correct only when the model's purpose does not require loss carryforwards. State that assumption in the model's notes.
Debt repayment limited by cash and balance
A debt repayment must meet two limits at once:
- It cannot be more than the cash available for repayment.
- It cannot be more than the debt still owed.
- It cannot be negative, because a negative repayment would mean borrowing.
The formula combines a floor and a cap:
=MIN(F41,MAX(0,F38))F41 is the opening debt balance and F38 is cash available for repayment. The inner MAX(0,F38) removes a negative cash figure, so a cash shortfall produces a repayment of zero. The outer MIN stops the repayment at the balance, so the model never repays more than it owes.
Here is a worked case with an opening balance of 1,000:
| Period | Opening balance | Cash available | MAX(0, cash) | Repayment | Closing balance |
|---|---|---|---|---|---|
| 1 | 1,000 | 300 | 300 | 300 | 700 |
| 2 | 700 | -50 | 0 | 0 | 700 |
| 3 | 700 | 900 | 900 | 700 | 0 |
| 4 | 0 | 400 | 400 | 0 | 0 |
Period 2 shows the floor at work. Period 3 shows the cap: 900 is available but only 700 is owed. Period 4 shows that once the balance is zero, the cap keeps repayment at zero no matter how much cash exists.
The closing balance row is simply the opening balance minus the repayment. Link each period's opening balance to the prior period's closing balance.
Watch for circularity
Cash available for repayment usually depends on cash flow, and cash flow depends on interest, and interest may depend on the debt balance. If interest uses the closing balance, which depends on repayment, the formula refers back to itself. This creates a circular reference. The common remedy is to calculate interest on the opening balance, which breaks the loop and is easy to audit. Use an average balance only if you deliberately accept and manage iterative calculation.
Common errors
- Swapped function. Using
MAXwhere you meantMINfor a cap gives a result that looks plausible in some periods and wrong in others. Test each limit with a value that should bind. - Floor placed after the multiplication.
=MAX(0,F30*$C$5)gives the same answer as=MAX(0,F30)*$C$5when the rate is positive, but it hides intent and breaks if the rate input is ever negative or blank-handled oddly. Floor the quantity you mean to limit. - Hard-coded limits. A
0as a floor is acceptable because zero is structural. A cap such as5000is an assumption and belongs in an input cell. - Crossed limits. If a minimum input exceeds a maximum input, nested
MIN/MAXsilently returns the wrong limit. Add a check cell that testsminimum<=maximum. - Text in numeric cells.
MINandMAXignore text inside a referenced range but not text typed directly as an argument, and a number stored as text in a cell reference is ignored without any error. Your limit may then disappear. Keep input cells numeric. - Inconsistent formulas across a row. If one period uses a different limit than its neighbors, the row no longer behaves as a single logic. Copy one formula across the whole timeline.
Making limits visible
A limit that works silently is hard to trust. Add a helper row that flags the periods where the limit binds. This reuses the 1/0 flag idea from earlier chapters:
=IF(F20*$C$3>$C$4,1,0)This returns 1 in any period where the uncapped bonus exceeds the cap. A row of these flags tells a reviewer at a glance where the cap matters, and a total across the row gives the number of binding periods. You can build the same kind of row for the debt cap by comparing available cash with the opening balance.
A second useful row shows the amount lost to the limit, the unlimited value minus the limited value. If that amount is nonzero in a period where you expected no limit, something is wrong with an input.
Putting it together
Limits and flags often work in the same formula. A bonus that applies only during a timing window, with a percentage cap, multiplies a flag by a limited value:
=F$8*MIN(F20*$C$3,$C$4)Row 8 holds the timing flag, 1 when the item is active and 0 otherwise. The cap applies first, then the flag switches the result on or off. Multiplying by a flag is easy to read, and it keeps the limit logic independent of the timing logic, so each can be checked on its own.
Exercise
A company has pre-tax income of -150 in period 1 and 600 in period 2. The tax rate in C5 is 20%. The opening debt balance in period 2 is 500, and 400 of cash is available for repayment in period 2 (cash in period 1 is -80 and the opening balance is 500). Using MAX and MIN, what is the tax in each period, and what is the debt repayment in each period?
Show answer
Tax in period 1 is MAX(0,-150)20% = 0. Tax in period 2 is MAX(0,600)20% = 120. Repayment in period 1 is MIN(500,MAX(0,-80)) = MIN(500,0) = 0. Repayment in period 2 is MIN(500,MAX(0,400)) = MIN(500,400) = 400, which leaves a closing balance of 100 if period 1 repaid nothing and the balance stayed at 500.
Exercise
A bonus formula is =MIN(F20*$C$3,$C$4) with C3 = 8% and C4 = 2,500. For which base amounts in F20 does the cap bind, and what flag formula would mark those periods?
Show answer
The cap binds when F208% exceeds 2,500, so when F20 is greater than 31,250. The flag formula is =IF(F20$C$3>$C$4,1,0).