How to Calculate Total Payments by Customer or Account in Excel
Question details
The user needs to calculate the total payment amounts for specific combinations of customers and accounts, ensuring all transactions are accounted for even if there is only one transaction per customer.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Summarizing financial data or sales records to find aggregated totals based on multiple criteria, specifically the customer name and the account ID.
- Observed behavior
- The goal is to generate accurate sum totals for each matching customer-account combination using functions or data summarization tools.
Ensure your dataset is organized in clear columns with headers (e.g., Customer, Account, Payment Amount) and verify that there are no merged cells or blank rows interrupting your data range.
Use the SUMIFS Function to Calculate Totals
The SUMIFS function is the most direct way to sum values based on multiple conditions, such as matching both the account and the customer name.
SUMIFS allows you to specify a range to sum, followed by multiple criteria ranges and the specific criteria you want to match. This guarantees that only rows matching both the specified customer and account are aggregated.
Click on the cell where you want the total payment amount to appear (e.g., cell F2).
Type the formula =SUMIFS($E$2:$E$6,$D$2:$D$6,D2,$C$2:$C$6,C2). In this example, column E contains the payment amounts, column D contains the accounts, and column C contains the customer names.
Press Enter to calculate the first total. Then, click the small square at the bottom-right corner of the cell (fill handle) and drag it down to apply the formula to the rest of the rows.

Combine IF, COUNTIFS, and SUMIFS for Cleaner Data
If you want to avoid repeating the total on every row for the same customer-account combination, you can combine SUMIFS with IF and COUNTIFS to display the total only on the first matching instance.
Create a PivotTable for Quick Aggregation
A PivotTable allows you to summarize and group your data automatically without writing any complex formulas.
Calculate Complex Totals Effortlessly in WPS Spreadsheet
WPS Spreadsheet provides full support for advanced functions like SUMIFS, COUNTIFS, and PivotTables, allowing you to summarize and analyze financial data accurately and efficiently.
- 1. Open your data file: Launch WPS Spreadsheet and open the workbook containing your customer and account payment data.
- 2. Use advanced formulas: Navigate to the Formula tab to easily insert SUMIFS and COUNTIFS functions using the intuitive dialog box prompts.
- 3. Summarize with PivotTables: Alternatively, go to the Insert tab and click PivotTable to quickly group and calculate payment totals without writing code.

Frequently Asked Questions
Why is my SUMIFS formula returning a #VALUE! error?
A #VALUE! error in a SUMIFS formula usually occurs when the criteria ranges are not exactly the same size as the sum range. For example, if your sum range is E2:E6 but your criteria range is D2:D7, the formula will fail. Ensure all ranges in the formula correspond to the exact same row numbers.
Can I sum payments based on more than two conditions?
Yes, the SUMIFS function can handle up to 127 range/criteria pairs. You can easily add more conditions to your formula, such as specifying a date range, a specific region, or a particular transaction type by simply appending them after your first two conditions.
How do I handle empty cells in my criteria ranges when using SUMIFS?
If you specifically want to sum rows where a criteria column is blank, you can use "=" as your criteria. However, to prevent calculation issues, it is highly recommended to clean your dataset and remove unintended blank rows before calculating aggregated totals.




