Function Problems

Use IF and MIN in Excel to Apply Variable Thresholds

Maira MehtabMaira Mehtab Dec 2, 2026 868 views

Question details

Create a formula that caps a value at a threshold determined by the column containing X.

Use IF and MIN in Excel to Apply Variable Thresholds
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.
Before you start

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.

Solution 1Recommended

Use nested IF and MIN functions to apply the matching cap

Use this formula when each marker column corresponds to a different maximum value.

1
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),""))).

2
Apply it to other rows

Press Enter, then drag the fill handle from G3 down column G to apply the formula to additional rows.

3
Check the result

Enter X in B3, C3, or D3 and a number in F3. G3 returns the number or the corresponding threshold, whichever is lower.

Use nested IF and MIN functions to apply the matching cap
Marker priority: If more than one column contains X, the formula uses the first match in the order B, C, then D. If none contains X, it returns a blank.
Work with spreadsheets in WPS

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. 1. Open your workbook: Open WPS Spreadsheets and use Open to select your Excel workbook.
  2. 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. 3. Fill the remaining rows: Press Enter, then drag the fill handle from G3 down to the rows you want to calculate.
  4. 4. Save the workbook: Choose File > Save or Save As and select the XLSX format if you need Excel compatibility.
Apply different caps with familiar IF and MIN functionsOpen and save Microsoft Excel XLSX filesCopy the formula down for multiple rowsUse WPS Office for free
microsoft office alternative - wps office

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.