Limit a Calculated Value in Excel with MIN and IF
Question details
Calculate a value from two cells only when a condition is met and limit the result to a maximum of 677.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet needs a capped adjustment based on the values in I26 and J26.
- Observed behavior
- The desired formula multiplies J26 by the absolute value of I26 when I26 is negative, returns zero otherwise, and caps the result at 677.
Check that I26 and J26 contain numeric values, and choose an empty cell for the result. Replace the cell references or the limit of 677 if your worksheet uses different inputs.
Use MIN and IF to cap the conditional calculation
Use this formula when the calculation should run only if I26 is negative.
In Excel, click the empty cell where you want the capped adjustment to appear.
Type =MIN(677,IF(I26<0,J26*-I26,0)) in the cell or formula bar, then press Enter.
Change or review the values in I26 and J26: a negative I26 triggers the multiplication, while zero or a positive I26 returns 0. MIN limits the result to 677.

Use MIN and MAX when J26 is always nonnegative
Use this shorter alternative if J26 is always zero or positive.
Apply the Same Capped Formula in WPS Spreadsheets
Open your workbook in WPS Spreadsheets and use MIN and IF to calculate and cap the adjustment.
- 1. Open the workbook: Launch WPS Spreadsheets and select Open to choose your Excel workbook.
- 2. Select a result cell: Click an empty cell where you want the capped value to appear.
- 3. Enter the formula: Type =MIN(677,IF(I26<0,J26*-I26,0)) in the cell or formula bar and press Enter.
- 4. Save the workbook: Select File > Save or Save As to save your changes in the desired spreadsheet format.

Frequently Asked Questions
How do I change the maximum from 677 to another value?
Replace 677 in the MIN formula with your preferred limit. For example, =MIN(500,IF(I26<0,J26*-I26,0)) caps the result at 500.
What happens when I26 is zero or positive?
The IF condition I26<0 is false, so =MIN(677,IF(I26<0,J26*-I26,0)) returns 0.
Why does the formula return a negative value?
If I26 and J26 are both negative, J26*-I26 is negative. MIN caps the upper value at 677 but does not prevent negative results.
What if Excel does not accept commas in the formula?
Your regional settings may require semicolons as argument separators. Try =MIN(677;IF(I26<0;J26*-I26;0)) in the formula bar.




