Power Query Problems

How to Calculate Annual and Year-to-Date Account Credits from Monthly Records in Excel

Rana GarciaRana Garcia Nov 13, 2026 869 views

Question details

The user needs to summarize recurring monthly account payment records into calendar-year and year-to-date credit totals by account.

How to Calculate Annual and Year-to-Date Account Credits from Monthly Records in Excel
Product
Microsoft Excel 365 / WPS Spreadsheets
Device & OS
not provided
Scenario
A table contains monthly account changes and payment values across multiple account columns, and the user wants aggregated annual and year-to-date credit summaries.
Observed behavior
The source table is in a cross-tab layout, so annual and year-to-date credits are not directly visible without unpivoting or formula-based aggregation.
Before you start

Make sure your monthly source table uses real date values in one column and that each account column contains only payment amounts. If you are using Power Query, keep a copy of the original worksheet before you unpivot.

Solution 1Recommended

Unpivot Account Columns with Power Query and Summarize with a PivotTable

Best for messy cross-tab monthly records because it converts each account-date-payment combination into one row and then aggregates by year and account.

Power Query preserves the original table and creates a clean normalized data model. Once the data is unpivoted, PivotTable aggregation handles annual totals without complex formulas.

1
Load the monthly table into Power Query

In WPS Spreadsheets, click any cell inside the account table, open the Data tab, and choose From Table/Range to load the selected range into Power Query.

2
Select and unpivot the account columns

In Power Query, select the Date column first, then Ctrl+click each account column such as AC01, AC02, AC03, and AC04. Right-click any selected account column and choose Unpivot Columns.

3
Rename the unpivoted columns

Rename the resulting Attribute column to Account and the Value column to Payment. Adjust data types to Date, Text, and Decimal Number if needed.

4
Close and load the cleaned result

Click Close & Load on the Home tab to return the unpivoted rows to a new worksheet in WPS Spreadsheets.

5
Create a PivotTable for annual credits

Select the loaded table, go to Insert > PivotTable, and place Account and Year in Rows. Drag Payment into Values to summarize credits by account and calendar year.

Unpivot Account Columns with Power Query and Summarize with a PivotTable
Recommended approach: Unpivoting reduces each account payment to one row, which makes annual and year-to-date totals easy to maintain when new months are added.

Use WPS Spreadsheets to Summarize Annual and Year-to-Date Account Credits

WPS Spreadsheets can load your monthly account table, unpivot recurring payment columns, and create a PivotTable or SUMIFS summary that shows annual and year-to-date credits by account.

  1. 1. Open your Excel monthly account workbook: Launch WPS Spreadsheets, click Open, and select the .xlsx or .xls file that contains the monthly account payment table.
  2. 2. Unpivot the account columns: Click inside the table, open Data > From Table/Range, select the account columns, and choose Unpivot Columns.
  3. 3. Build the annual and year-to-date summary: Close & Load the result, then insert a PivotTable or use SUMIFS formulas with Year and Date criteria to return totals by account.
Power Query-style data shaping to unpivot account columns cleanlyPivotTable and SUMIFS support for fast annual and year-to-date summariesFull compatibility with Excel .xlsx and .xls account workbooksFree, lightweight spreadsheet with a familiar ribbon interface
QA img-9

Frequently Asked Questions

How do I unpivot multiple account columns without losing the date column?

In Power Query, select the Date column first, then select the account columns, right-click one of the selected account columns, and choose Unpivot Columns. The Date column remains a separate row field.

Can I use SUMIFS to calculate year-to-date credits?

Yes. Use SUMIFS with the payment column, account column, and date criteria that start at January 1 of the target year and end at the current date or a selected reporting date.

Why do I see repeated account rows after unpivoting?

Unpivoting creates one row per original account column and date. Aggregate the unpivoted rows with a PivotTable or SUMIFS so each account and year appears once.

Does WPS Spreadsheets support Excel dynamic array formulas such as VSTACK or MAKEARRAY?

WPS Spreadsheets opens Excel files with high compatibility, but very new dynamic array functions may depend on your WPS version. For a stable summary, use Power Query and PivotTable or SUMIFS.

How do I summarize account credits by both account and calendar year in a PivotTable?

After loading the unpivoted data, insert a PivotTable, drag Account to Rows, add a Year field to Rows or Columns, and drag Payment to Values.