Function Problems

Use a WPS Spreadsheets IF Formula to Calculate When a Cell Is Not Blank

Maira MehtabMaira Mehtab Dec 2, 2026 869 views

Question details

Use a formula to leave R1 blank when L1 is empty and otherwise calculate M1 minus L1.

Calculate Only When a Cell Is Not Blank in WPS Spreadsheets
Product
WPS Spreadsheets
Device & OS
not provided
Scenario
A spreadsheet needs to calculate the difference between two cells only when L1 has a value.
Observed behavior
R1 should appear blank when L1 is empty and display the result of M1 minus L1 otherwise.
Before you start

Open the spreadsheet and locate cells L1, M1, and R1. Make sure R1 is available for the result and that L1 and M1 contain values suitable for subtraction.

Solution 1Recommended

Use IF to Check L1 Before Subtracting

Enter one formula in R1 to suppress the result until L1 has a value.

1
Select the result cell

Click cell R1 in your spreadsheet.

2
Enter the IF formula

Type =IF(L1="","",M1-L1) in R1 or in the formula bar, then press Enter.

3
Check the result

Leave L1 empty to confirm that R1 appears blank, then enter a numeric value in L1 to calculate M1 minus L1.

Use IF to Check L1 Before Subtracting
The formula remains in R1: The formula returns an empty text string when L1 is empty, so R1 looks blank but still contains a formula. The same condition also treats a formula in L1 that returns an empty string as blank.
WPS Spreadsheets

Calculate Conditionally with IF in WPS Spreadsheets

Use WPS Spreadsheets to enter an IF formula that keeps the result visually blank until L1 has a value, then subtracts L1 from M1.

  1. 1. Open the spreadsheet: Open WPS Spreadsheets and select your workbook.
  2. 2. Select R1: Click cell R1, where you want the result to appear.
  3. 3. Enter the formula: Type =IF(L1="","",M1-L1) and press Enter.
  4. 4. Test the calculation: Enter values in L1 and M1 and check that R1 displays their difference. Clear L1 to confirm that R1 appears blank.
Calculate a difference only when the input cell has a valueOpen and edit Microsoft Excel XLS and XLSX filesUse a familiar spreadsheet interface and formula bar
microsoft office alternative - wps office

Frequently Asked Questions

What formula subtracts L1 from M1 only when L1 is not blank?

Enter =IF(L1="","",M1-L1) in R1 and press Enter. R1 appears blank when L1 is empty; otherwise, it displays M1 minus L1.

Is R1 truly empty when the formula returns a blank?

No. R1 still contains the IF formula, which returns an empty text string. Select R1 to see the formula in the formula bar.

What if L1 contains a formula that returns an empty string?

The test L1="" treats that result as blank, so R1 also displays an empty string.

Can I use the same formula in Microsoft Excel?

Yes. Enter =IF(L1="","",M1-L1) in cell R1 in Excel. WPS Spreadsheets can also open and edit Excel XLS and XLSX files.