Formula Errors

How to Use an IF Formula to Replace a Calculated Amount with Zero in WPS Office

John WilsonJohn Wilson Nov 13, 2026 869 views

Question details

Replace a calculated amount with zero when a separate YES/NO condition cell is met by wrapping the original calculation in an IF function.

Use an IF Formula to Replace a Calculated Amount with Zero
Product
WPS Office Spreadsheets
Device & OS
not provided
Scenario
A worksheet has one cell that calculates an amount and another cell that displays YES or NO; the user wants the calculated amount to become zero when the condition is met.
Observed behavior
The calculated cell continues to display the original calculation result even after the YES/NO condition cell changes.
Before you start

Open the workbook in WPS Office Spreadsheets and identify the calculated cell and the cell that displays YES or NO. Confirm the exact cell reference and the current formula before editing.

Solution 1Recommended

Wrap the Existing Calculation in an IF Function

Use this when you already have a working formula and only need to make the result conditionally zero based on a YES/NO cell.

The IF function checks whether the condition cell equals YES. If it does, the formula returns 0; if it does not, the formula returns the original calculation.

1
Select the calculated cell

Click the cell that currently contains =some_formula, then click the formula bar or press F2 to edit the formula.

2
Enter the IF formula

Replace the current formula with =IF(cell_2="YES",0,some_formula). Substitute cell_2 with the cell that displays YES or NO and some_formula with your original calculation.

3
Apply currency formatting if needed

Press Enter. If the result should display as a monetary value, select the cell, go to the Home tab, open Number Format, and choose Currency or Accounting.

Wrap the Existing Calculation in an IF Function
Formula updated: The calculated cell now returns 0 when the condition cell is YES and the original result otherwise.
WPS Spreadsheets formula help

Use IF to replace calculated amounts with zero in WPS Office Spreadsheets

Apply the IF function in WPS Office Spreadsheets to return zero when a YES/NO condition cell is met and keep the original calculation otherwise. The built-in formula editor and number formatting tools make the change quick and compatible with existing workbooks.

  1. 1. Open your workbook in WPS Spreadsheets: Launch WPS Office and open the worksheet that contains the calculated amount and the YES/NO condition cell.
  2. 2. Edit the calculated cell formula: Select the cell with the original calculation and click the formula bar.
  3. 3. Enter the IF formula: Type =IF(cell_2="YES",0,some_formula) and replace cell_2 and some_formula with your actual cell reference and calculation.
  4. 4. Apply number formatting if necessary: With the result cell selected, go to Home > Number Format and choose Currency or Accounting for monetary values.
  5. 5. Test the result: Change the condition cell between YES and NO to confirm that the formula returns zero or the original calculation.
Wraps your existing calculation directly without creating extra helper columnsWorks with XLSX and Microsoft Excel workbook formatsFree and lightweight spreadsheet editing in WPS OfficeSupports currency and accounting formatting for financial reports
microsoft office alternative - wps office

Frequently Asked Questions

Can I use this IF formula with any original calculation?

Yes. Replace some_formula with your existing calculation, such as =A1*B1 or =SUM(C1:C10). The IF function will return either 0 or that calculation depending on the condition cell.

How do I reference a YES/NO cell on another sheet?

Include the sheet name in the reference, for example =IF(Sheet2!A2="YES",0,A1*B1). In WPS Spreadsheets you can type the reference manually or select the cell after typing =IF(.

Do I need to change the cell format after using the IF formula?

If the result should display as currency, select the cell, go to the Home tab, open Number Format, and choose Currency or Accounting. Otherwise the zero may display as a plain number.

What happens when the condition cell is empty or says NO?

The IF function returns the original calculation result when the cell is not exactly YES. Use a nested IF or another logical test if empty cells must behave differently.

Can this approach be used when the formula returns text?

Yes. The same IF structure works with text results. Replace some_formula with your text formula and use 0 or "" as the YES result, depending on how you want the cell to display.