Function Problems

How to Sum Values When Each Date Is Before or Equal to Another Date in WPS Office Spreadsheet

Camila MilosovichCamila Milosovich Nov 13, 2026 869 views

Question details

The user needs a formula that sums a numeric column only for rows where the status is Closed and the closure date is less than or equal to the row-specific target date, because SUMIFS cannot compare two criteria ranges row by row.

How to Sum Values When Each Date Is Before or Equal to Another Date in WPS Office Spreadsheet
Product
WPS Office Spreadsheet
Device & OS
not provided
Scenario
The user has a table with value, status, closure date, and target date columns and needs a row-wise conditional sum.
Observed behavior
SUMIFS cannot directly compare each row's closure date to the matching target date, so an array-based SUMPRODUCT formula is required.
Before you start

Confirm that the status column contains the exact text "Closed", the date columns contain valid dates, and all formula ranges cover the same number of rows.

Solution 1Recommended

Use SUMPRODUCT to sum values with a row-by-row status and date condition

Use this approach when SUMIFS cannot evaluate a closure date against a matching target date on the same row.

SUMPRODUCT evaluates arrays row by row and can handle two equally sized date ranges in one condition.

The double unary operator -- converts TRUE/FALSE results from the status and date comparisons into 1/0 values so they can be multiplied with the amount column.

1
Select the result cell

Click the cell where you want the conditional sum to appear, such as E1.

2
Enter the SUMPRODUCT formula

Type =SUMPRODUCT(A2:A7,--(B2:B7="Closed"),--(C2:C7<=D2:D7)) and press Enter.

3
Check the returned total

Verify that the result includes only rows with status Closed and a closure date on or before the matching target date.

Use SUMPRODUCT to sum values with a row-by-row status and date condition
No helper column required: The formula performs the row-wise comparison directly and returns the conditional sum.
Direct WPS Office solution

Sum Row-Specific Date and Status Conditions with SUMPRODUCT in WPS Office Spreadsheet

Open your workbook in WPS Office Spreadsheet and use a SUMPRODUCT array formula to sum values only when each row is Closed and its closure date is on or before the matching target date.

  1. 1. Open your workbook in WPS Office Spreadsheet: Launch WPS Office, click Menu > Open, and select the .xlsx or .xls file that contains your data.
  2. 2. Select the result cell: Click the cell where you want the conditional sum result to appear, such as E1.
  3. 3. Enter the SUMPRODUCT formula: Type =SUMPRODUCT(A2:A7,--(B2:B7="Closed"),--(C2:C7<=D2:D7)) and press Enter.
  4. 4. Confirm the result: Check that the total matches only the rows with status Closed and a closure date on or before the target date.
Row-by-row date comparison without helper columnsUses the familiar SUMPRODUCT syntax also available in ExcelFull compatibility with .xlsx and .xls workbooksFree, lightweight Office suite for everyday spreadsheet tasks
microsoft office alternative - wps office

Frequently Asked Questions

Why can't I use SUMIFS to compare each closure date with its matching target date?

SUMIFS compares criteria ranges to specific criteria values or separate criteria, but it does not perform a row-by-row comparison between two equal-sized date ranges. Use SUMPRODUCT to evaluate both conditions for each row.

What does -- mean in the SUMPRODUCT formula?

The double unary operator -- converts TRUE and FALSE results from each condition into 1 and 0, so SUMPRODUCT can multiply and sum the arrays.

Can I use this SUMPRODUCT formula in WPS Office Spreadsheet?

Yes, WPS Office Spreadsheet supports SUMPRODUCT and array-style calculations. You can enter the same formula directly into any cell.

Do all ranges in the SUMPRODUCT formula need to be the same size?

Yes, the amount range, status range, closure date range, and target date range must contain the same number of rows. Otherwise the formula returns an error or an unexpected result.