Numbers formula for conditional maximum

write a formula in numbers for a sentence that says if value is greater than 87,500, value-87500 OR 150000-87500 whichever is greater

MacBook Pro 14″, macOS 15.7

Posted on Feb 2, 2026 2:05 AM

Reply
7 replies

Feb 3, 2026 11:03 AM in response to Badunit

> The LET function can help with that but it would still be complicated.


Agreed... the rules are complex, but I think this is something that LET() can help with, especially with the reuse of values.


Here's my run at it using LET()



=LET(sales,B3,

     tier1_floor,87500,

     tier2_floor,150000,

     tier3_floor,200000,
	


     tier1_eligible,MIN(tier2_floor,sales)−tier1_floor,

     tier1,MAX(0,tier1_eligible)×0.2,
	


     tier2_eligible,MIN(tier3_floor,sales)−tier2_floor,

     tier2,MAX(0,tier2_eligible)×0.25,


     tier3_eligible,MAX(0,sales−tier3_floor),

     tier3,MAX(0,tier3_eligible)×0.3,


     tier1+tier2+tier3)


It looks complex, but the idea is actually pretty simply.


LET() starts by defining a couple of variables, so we can use names rather than cell references for some of the values. This gives a central place to define the bonus boundaries. I used hardcoded values, but these could easily be lookups or references to other cells.


The formula then works out how much of the sales are eligible for the tier 1 bonus, by calculating the lower of tier2's floor (150,000) and the sales. This is then multiplied by 0.2 to calculate the amount of Tier 1 bonus. (note this could be done in one line, but I prefer to break it out for clarity.


     tier1_eligible,MIN(tier2_floor,sales)−tier1_floor,

     tier1,MAX(0,tier1_eligible)×0.2,
	




A similar method is used to calculate the tier 2 bonus - subtract the sales from the tier3 floor and multiply it by 0.25 to calculate the tier2 bonus


Then we do a similar thing again with the tier3 bonus (although this time I don't cap it - I assumed that everything above 200,000 is rated at 0.3, whereas Badunit capped at 400,000 (a good problem to have? :) )


At the end, it's a simple matter of adding the various tierx bonus values to get the answer you're looking for.

Feb 2, 2026 4:59 AM in response to SKKKKK56

And looking at the table if B2 is less than 87500, the result should be zero. Basically, if an employee males 87,499 in sales, they get 0 Bonus. If they make over 87500, the bonus structure starts and looks like this:

So his first quarter, he made 80,000 in sales and earned no bonus. His second, he made 165,000 so he got 0.2(15000). This quarter, he made 179658 in sales, so he would get the max of tier 1 which is 0.2(150000-87500)+0.25(179658-150000.01). I have been calculating them by hand but want a formula to automatically do the correct calculations with the correct boundaries.


Thank you!

Feb 2, 2026 9:31 AM in response to SKKKKK56

Here is a formula to replicate the results of that table. I think there is an easier way to do this with MOD and stuff or it could be done with a lookup table. The problem I have with my formula, aside from its length, is that it repeats some constants a few times which makes it easy to mess up if something has to change (like changing the 0.2 multiplier to 0.21 would require changing it in 3 places). The LET function can help with that but it would still be complicated.


=IFS(B3<87500,0,B3≤150000, 0.2×(B3−87500),B3≤200000,0.2×(150000−87500)+0.25×(B3−150000),B3≤400000, 0.2×(150000−87500)+0.25×(200000−150000)+0.3×(B3−200000),TRUE, "what about if over 400K?")



Numbers formula for conditional maximum

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.