Formula Errors

Correct an Excel IF Formula for a Piecewise Percentage Calculation

Amos GikundaAmos Gikunda Nov 18, 2026 869 views

Question details

Correct an Excel IF formula that calculates different values at or below 50% and above 50%.

Correct an Excel IF Formula for a Piecewise Percentage Calculation
Product
Microsoft Excel
Device & OS
not provided
Scenario
A percentage in cell A6 determines which branch of a piecewise calculation is used.
Observed behavior
The formula produces unexpected values after the percentage exceeds 50%.
Before you start

Check that A6 contains a numeric percentage: 50% is stored as 0.5 in Excel. Confirm that the intended result at exactly 50% is 30 and that negative results above 50% are expected.

Solution 1Recommended

Correct the IF formula's second calculation

Use this formula when values up to and including 50% should be multiplied by 60, and values above 50% should use 60 times the percentage minus 60.

1
Select the result cell

In Excel, select the cell where you want the calculated result to appear.

2
Enter the corrected formula

Type =IF(A6<=0.5,60*A6,60*(A6-1)) in the formula bar and press Enter. Alternatively, use =IF(A6<=0.5,60*A6,60*A6-60).

3
Test the threshold

Enter 50%, 51%, and 100% in A6 in turn. The formula should return 30, -29.4, and 0, respectively.

Correct the IF formula's second calculation
Negative results are part of this formula: The result jumps from 30 at 50% to a negative value just above 50%. If negative results are not intended, confirm the desired calculation before changing the formula.
Calculate with WPS Spreadsheets

Use the same piecewise IF formula in WPS Spreadsheets

Open your workbook in WPS Spreadsheets and enter the corrected IF formula to calculate values on either side of the 50% threshold.

  1. 1. Open the workbook: Launch WPS Office, open Spreadsheets, and choose Open to select your Excel workbook.
  2. 2. Check the percentage: Select A6 and confirm it contains a numeric percentage, such as 50%.
  3. 3. Enter the formula: Select the result cell, type =IF(A6<=0.5,60*A6,60*(A6-1)) in the formula bar, and press Enter.
  4. 4. Test and save: Try 50% and 51% in A6 to check the results, then choose File > Save to save the workbook.
Apply an IF formula to a percentage thresholdOpen and edit Microsoft Excel XLSX filesUse a familiar spreadsheet interfaceWork with a free Office suite
microsoft office alternative - wps office

Frequently Asked Questions

What does the formula return at exactly 50%?

When A6 is 50%, the <=0.5 condition is true, so 60*A6 returns 30.

Why is the result negative just above 50%?

Above 50%, the formula uses 60*(A6-1). For example, 51% produces 60*(0.51-1), or -29.4. This is expected for the specified calculation.

What is the difference between subtracting 6 and subtracting 60?

In the second branch, 60*A6-60 is equivalent to 60*(A6-1). Using 60*A6-6 changes the result by 54 and does not match the intended formula.

What if Excel rejects the commas in the formula?

Some regional settings use semicolons as argument separators. Try =IF(A6<=0.5;60*A6;60*(A6-1)) and use your regional decimal separator if needed.