Add Amounts to Selected Cost Codes in Excel with a Transaction Table
Question details
The user needs to add transaction amounts to a summary organized by selected cost codes while preserving transaction history and supporting reliable reporting.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A cost-code worksheet contains summary cells, and the user wants to record a new amount under the appropriate selected code.
- Observed behavior
- Adding an amount directly to a summary cell can overwrite previous values and does not create an auditable transaction history.
Prepare a worksheet for a transaction table with columns for Date, Code, Amount, and Description. Confirm that each transaction will be recorded as a separate row and that cost codes use consistent spelling or values.
Create a transaction table and summarize amounts with a PivotTable
Use this approach when you need a reliable history of entries, auditing, filtering, and reports by cost code.
A transaction table is safer than writing new amounts directly into summary cells because each entry remains available for review. A PivotTable can then group and total the transactions by cost code without changing the source records.
In a blank worksheet, enter Date, Code, Amount, and Description as column headers in row 1.
Select the headers and the entry range, then choose Insert > Table and confirm that the table has headers.
Enter the date, cost code, amount, and description in the next empty table row instead of editing an existing summary total.
Click inside the table, open Insert > PivotTable, and place Code in the Rows area and Amount in the Values area.
After adding more transactions, right-click the PivotTable and choose Refresh to update totals by cost code.
Calculate totals by cost code with SUMIFS
Use this option when you prefer a formula-based summary that updates as new rows are added to the transaction table.
Track cost-code transactions and summarize totals in WPS Spreadsheets
WPS Spreadsheets lets you record each cost-code transaction in a structured table, then summarize amounts with a PivotTable or SUMIFS formulas. This preserves history and supports familiar spreadsheet reporting workflows.
- 1. Build the transaction table: Open WPS Spreadsheets, enter Date, Code, Amount, and Description headers, select the range, and choose Insert > Table.
- 2. Record each amount: Add every transaction as a new row in the table, including its cost code and description.
- 3. Create a summary: Select the table, choose Insert > PivotTable, and place Code in Rows and Amount in Values.
- 4. Update totals: When new rows are added, right-click the PivotTable and select Refresh, or use a SUMIFS formula for a live code-based summary.

Frequently Asked Questions
Why should I use a transaction table instead of adding an amount directly to a summary cell?
A transaction table preserves every date, code, amount, and description as a separate record. Directly changing a summary cell can overwrite earlier information and makes auditing difficult.
How do I total amounts for one selected cost code?
Use a PivotTable with Code in the Rows area and Amount in the Values area, or use a formula such as =SUMIFS(Transactions[Amount],Transactions[Code],A2) when the data is stored in a structured table.
Will a PivotTable update automatically when I add a new transaction?
The source table expands when a new row is entered, but the PivotTable may require an update. Right-click the PivotTable and select Refresh to display the latest totals.
Can I keep the cost-code summary on a separate worksheet?
Yes. Store the detailed transaction table on one sheet and create the PivotTable or SUMIFS-based summary on another sheet for cleaner reporting.




