Use IF and MIN in Excel to Apply Variable Thresholds
Question details
Create a formula that caps a value at a threshold determined by the column containing X.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A value in column F needs a different maximum depending on whether column B, C, or D contains X.
- Observed behavior
- The formula should return the lower of the column F value and the applicable threshold, or a blank if no X is present.
Check that the value in F3 is numeric and that the markers are in B3, C3, or D3. The thresholds in this example are 1,000,000, 1,333,333, and 1,666,666, respectively.
Use nested IF and MIN functions to apply the matching cap
Use this formula when each marker column corresponds to a different maximum value.
Select G3 and enter =IF(B3="x",MIN(F3,1000000),IF(C3="x",MIN(F3,1333333),IF(D3="x",MIN(F3,1666666),""))).
Press Enter, then drag the fill handle from G3 down column G to apply the formula to additional rows.
Enter X in B3, C3, or D3 and a number in F3. G3 returns the number or the corresponding threshold, whichever is lower.

Apply variable thresholds in WPS Spreadsheets
Use the same nested IF and MIN formula in WPS Spreadsheets to cap values according to their marker column.
- 1. Open your workbook: Open WPS Spreadsheets and use Open to select your Excel workbook.
- 2. Enter the formula: Select G3 and enter =IF(B3="x",MIN(F3,1000000),IF(C3="x",MIN(F3,1333333),IF(D3="x",MIN(F3,1666666),""))).
- 3. Fill the remaining rows: Press Enter, then drag the fill handle from G3 down to the rows you want to calculate.
- 4. Save the workbook: Choose File > Save or Save As and select the XLSX format if you need Excel compatibility.

Frequently Asked Questions
What happens if the value is below the threshold?
MIN returns the value in column F. For example, if B3 contains X and F3 is 900000, G3 returns 900000.
Which threshold applies if more than one column contains X?
The formula checks B3 first, then C3, then D3. It uses the threshold for the first matching column.
Can I return zero instead of a blank when there is no X?
Yes. In the formula in G3, replace the final "" with 0.
Does the marker have to be a lowercase x?
No. The comparison B3="x" is not case-sensitive, so it matches both X and x.




