Function Problems

Use Last Month’s Budget Value for Blank or Zero Cells in WPS Spreadsheets

Algirdas JasaitisAlgirdas Jasaitis Nov 18, 2026 871 views

Question details

Calculate a budget total using the current month’s value for each row, or the previous month’s value when the current value is blank or zero.

Use Last Month’s Budget Value When This Month Is Blank or Zero
Product
Spreadsheet software, including WPS Spreadsheets and Microsoft Excel
Device & OS
not provided
Scenario
The previous month’s values are in C15:C44 and the current month’s values are in D15:D44.
Observed behavior
The desired total should include one value per row: the current month’s value when it is nonzero, otherwise the previous month’s value.
Before you start

Check that column C contains the previous month’s numeric values and column D contains the current month’s values. Adjust the cell references if your budget uses different columns or rows.

Solution 1Recommended

Use an IF formula for each budget row

Use a helper column to handle both blank and zero current-month cells, including cells containing formulas that return an empty string.

1
Enter the fallback formula

In an empty helper cell such as E15, enter =IF(OR(D15="",D15=0),C15,D15).

2
Fill the remaining rows

Select E15 and drag its fill handle down through E44 to apply the formula to each budget row.

3
Calculate the total

In an empty total cell, enter =SUM(E15:E44). Check a few rows to confirm that blank or zero values in column D use the corresponding values from column C.

Use an IF formula for each budget row
Budget formulas in WPS Spreadsheets

Calculate Your Budget Fallback Total in WPS Spreadsheets

Use WPS Spreadsheets to choose the previous month’s value whenever the current month is blank or zero, then sum the selected values.

  1. 1. Open the budget: Open your workbook in WPS Spreadsheets and locate the previous- and current-month columns.
  2. 2. Add the formula: In E15, enter =IF(OR(D15="",D15=0),C15,D15), adjusting the references if needed.
  3. 3. Fill the helper column: Drag the fill handle from E15 down to E44 to calculate the selected value for each row.
  4. 4. Sum the values: Enter =SUM(E15:E44) in an empty cell to display the budget total.
Use IF and OR to select the right value for each budget rowFill the formula down a column and total the results with SUMOpen and edit Microsoft Excel XLSX and XLS filesReview the selected values before calculating the total
microsoft office alternative - wps office

Frequently Asked Questions

How do I use last month’s value when the current cell is blank or zero?

For a current value in D15 and a previous value in C15, enter =IF(OR(D15="",D15=0),C15,D15) in an empty cell.

Will the IF formula also handle a cell that contains a formula returning an empty string?

Yes. The D15="" test in =IF(OR(D15="",D15=0),C15,D15) also checks for an empty-string result.

Can I calculate the total without a helper column?

You can use =SUM(D15:D44)+SUMIF(D15:D44,0,C15:C44). Check the result against your blank and zero entries; use the helper-column method if missing entries do not behave as expected.

What happens if the current month’s value is negative?

The IF formula uses the negative current-month value because it is neither blank nor zero.