WPS Spreadsheets: Combine Positive and Negative Totals Without a PivotTable
Question details
The user needs to summarize grouped amounts into separate positive and negative totals without creating a PivotTable.
- Product
- WPS Spreadsheets
- Device & OS
- not provided
- Scenario
- A worksheet contains Particulars and Amount columns in Table1, and the user wants a compact two-row summary of the grouped totals.
- Observed behavior
- The desired positive and negative totals are not yet combined into a single dynamic summary table.
Confirm that the source range is formatted as Table1 and that its columns are named Particulars and Amount. Use a WPS Spreadsheets version that supports LET, UNIQUE, SUMIF, HSTACK, and VSTACK for the one-cell formula.
Use one dynamic-array formula for positive and negative totals
Use this method when your WPS Spreadsheets version supports modern dynamic-array functions and the source data is stored in Table1.
The formula first creates a unique list of particulars, calculates each grouped amount, and then adds the nonnegative and negative grouped totals into a compact two-row result.
Click an empty cell such as D3 where the summary table can expand into adjacent cells and rows.
Paste =LET(particulars,UNIQUE(Table1[Particulars]),amounts,SUMIF(Table1[Particulars],particulars,Table1[Amount]),positives,SUM(IF(amounts>=0,amounts)),negatives,SUM(IF(amounts<0,amounts)),HSTACK({"Positives";"Negatives"},VSTACK(positives,negatives))) into the selected cell.
Press Enter. WPS Spreadsheets spills a two-column result with Positives and Negatives labels and their corresponding totals.
If the formula returns a reference or name error, open the table and verify that it is named Table1 and that the headers exactly match Particulars and Amount.

Build the grouped totals with helper cells
Use helper formulas when dynamic-array functions are unavailable or when you want to review each grouped amount before calculating the two final totals.
Create Positive and Negative Summary Totals in WPS Spreadsheets
WPS Spreadsheets can group the source amounts and return separate positive and negative totals with a single dynamic-array formula, without requiring a PivotTable. Its familiar spreadsheet interface also makes it easy to inspect the source table and adjust the output.
- 1. Open the workbook: Launch WPS Spreadsheets and open the workbook containing the Particulars and Amount columns.
- 2. Verify the source table: Select the source data, use the table tools to confirm the table name is Table1, and check the headers Particulars and Amount.
- 3. Enter the formula: Click an empty output cell and enter the LET formula that uses UNIQUE, SUMIF, IF, HSTACK, and VSTACK to calculate the two totals.
- 4. Review the spilled summary: Press Enter and check the generated Positives and Negatives rows. Correct the table name or column headers if an error appears.

Frequently Asked Questions
What table structure does the formula require?
The source must be an Excel-style table named Table1 with columns named Particulars and Amount. If your table has a different name, replace Table1 in each structured reference.
Does the formula treat zero as positive?
Yes. The condition amounts>=0 places zero-valued grouped totals in the Positives result. Change the condition to amounts>0 if zero should be excluded.
Can I calculate totals for each particular instead of only two totals?
Yes. Enter =SORT(UNIQUE(Table1[Particulars])) in an empty cell and =SUMIF(Table1[Particulars],D3#,Table1[Amount]) beside it to return each particular and its grouped total.
Why does the dynamic-array formula return an error?
Check that the WPS Spreadsheets version supports LET, UNIQUE, HSTACK, and VSTACK, that Table1 exists, and that the headers exactly match Particulars and Amount. Also make sure the spill area is empty.
Can I use this method with an XLSX workbook?
Yes. WPS Spreadsheets supports opening and saving Microsoft Excel XLSX workbooks. Keep the workbook in XLSX format if it will also be edited in Microsoft Excel.




