Formula Errors

Fix an Excel SUMPRODUCT Formula for Calculating Client Hours

Emma BrownEmma Brown Nov 2, 2026 868 views

Question details

The user needs to correct a complex Excel formula that fails when calculating working hours by client and month because the MATCH function cannot process a range as a single lookup value.

Fix an Excel SUMPRODUCT Formula for Calculating Client Hours
Product
Excel
Device & OS
not provided
Scenario
Calculating total hours categorized by specific clients and specific calendar months using multiple criteria.
Observed behavior
A complex formula combining SORT, UNIQUE, FILTER, SUM, IF, FREQUENCY, and MATCH returns an error because MATCH fails to process an entire range as a lookup value.
Before you start

Ensure that your date, client name, and hours ranges (e.g., $A$4:$A$38) are exactly the same size before applying array-based formulas like SUMPRODUCT.

Solution 1Recommended

Use SUMPRODUCT with Double Unary Operators

Replace the complex MATCH formula with a streamlined SUMPRODUCT function that handles array evaluations efficiently.

The SUMPRODUCT function can easily process arrays with multiple conditions. By using the double unary operator (--), you can convert Boolean results (TRUE and FALSE) into numeric values (1 and 0).

This allows SUMPRODUCT to multiply these 1s and 0s against your data range, thereby only summing the hours that match both the specific month and the client.

1
Select the target cell

Click on the cell where you want the calculated total client hours to appear.

2
Enter the SUMPRODUCT formula

Type the formula using the double unary operator for your criteria. For example: =SUMPRODUCT(--(MONTH($A$4:$A$38)=7),--($E$4:$E$38=H4),$D$4:$D$38)

3
Execute the calculation

Press Enter to calculate the result. The formula evaluates the arrays and returns the summed hours for month 7 and the client specified in cell H4.

Use SUMPRODUCT with Double Unary Operators
Formula Evaluation: The first minus sign converts TRUE/FALSE to -1/0, and the second minus sign converts those values to positive 1 and 0, which SUMPRODUCT successfully processes.
Calculate Client Hours Efficiently

Manage Complex Data and Formulas Easily with WPS Spreadsheet

WPS Spreadsheet fully supports advanced array formulas, including SUMPRODUCT, making it easy to accurately calculate hours by client and month. It provides an intuitive interface and powerful formula analysis tools to help you troubleshoot data errors instantly.

  1. 1. Open your workbook in WPS Spreadsheet: Launch WPS Office and open your existing spreadsheet containing the client hours data.
  2. 2. Apply the SUMPRODUCT formula: Click into the desired calculation cell and input your SUMPRODUCT formula with double unary operators just as you would in Excel.
  3. 3. Use formula auditing if needed: Navigate to the Formulas tab and select Evaluate Formula to verify that your Boolean arrays are correctly converting to 1s and 0s.
100% compatible with Microsoft Excel formulas, including SUMPRODUCT, MATCH, and array functions.Built-in Formula Evaluator feature to help you visualize and troubleshoot complex formula logic step-by-step.Advanced PivotTable and data visualization features for effortless data reporting.Lightweight and completely free to use for both basic and professional data processing.
microsoft office alternative - wps office

Frequently Asked Questions

What does the double dash (--) mean in an Excel formula?

The double dash, or double unary operator, is used to coerce Boolean values (TRUE or FALSE) into numeric values (1 or 0). The first dash converts TRUE to -1, and the second dash turns it into positive 1, allowing mathematical functions like SUMPRODUCT to use the results in calculations.

Why does my MATCH function return an error when using a range?

The MATCH function is strictly designed to look up a single value within a one-dimensional array. When you input an entire range as the lookup_value argument without wrapping it in an array formula wrapper, it cannot process the multiple values simultaneously and returns an error.

Are there other alternatives to SUMPRODUCT for multiple criteria?

Yes, you can also use the SUMIFS function to sum values based on multiple criteria. SUMIFS is often faster to calculate than SUMPRODUCT, but SUMPRODUCT offers more flexibility when you need to manipulate arrays, such as extracting the month from a date range directly inside the formula.