How to Calculate Monthly Differences Using Excel Dynamic Arrays
Question details
The user needs to calculate month-to-month value differences across a table and return the reshaped, unpivoted results in a single spilled list using modern dynamic array formulas.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Analyzing monthly changes across a tabular dataset and transforming the result into a flat, normalized list without manual formula dragging.
- Observed behavior
- Instead of manually calculating differences and copying formulas down, the goal is to output a dynamic, spilled array that updates automatically when data changes.
Ensure you are using a modern version of Excel or WPS Office that supports dynamic array functions like LET, HSTACK, VSTACK, and TOCOL.
Use LET and TOCOL to Offset and Unpivot Data
Use the LET function combined with HSTACK and TOCOL to calculate differences and output a clean, 3-column list in a single formula.
This method shifts the data array by one column using TAKE and DROP, subtracts it from the original data to find the monthly differences, and then unpivots the matrix into a flat list using TOCOL.
Select the cell where you want the spilled array to start. Begin your formula with =LET() and define your core data array, row headers, and dates.
Create a variable for the offset data using HSTACK(TAKE(data,,1), DROP(data,,-1)). This shifts the values by one column to align adjacent months for subtraction.
Define the difference variable by simply subtracting the offset array from your original data array (e.g., difference, data - offsetData).
Combine your row headers, dates, and calculated differences into a single normalized table using HSTACK(TOCOL(rowHeader), TOCOL(broadcastDate), TOCOL(difference)). Press Enter to spill the array.

Alternative Method Handling First-Month Blanks
A structured approach that handles the first month cleanly by returning blanks instead of zeros and includes custom headers.
Easily Calculate Dynamic Arrays in WPS Spreadsheet
WPS Office fully supports modern dynamic array functions, allowing you to easily handle complex data reshaping, offset calculations, and month-to-month analyses in a familiar interface.
- 1. Open WPS Spreadsheet: Launch WPS Office and open your workbook containing the monthly tabular data.
- 2. Input the array formula: Select the destination cell and type in your LET formula utilizing HSTACK and TOCOL for the offset calculations.
- 3. Spill the results: Press Enter to execute the formula. The month-to-month differences will dynamically spill down the rows automatically.

Frequently Asked Questions
What are dynamic array formulas?
Dynamic array formulas allow you to write a single formula that returns multiple values, automatically "spilling" the results into adjacent empty cells without needing to copy the formula manually down a column.
Why does my formula return a #SPILL! error?
A #SPILL! error occurs when the output range required for the dynamic array is blocked by existing data or text. You must clear the blocking cells to allow the formula to expand properly.
Can I use functions like TOCOL and HSTACK in older spreadsheet versions?
No, functions like LET, TOCOL, HSTACK, and VSTACK are part of modern dynamic array engines. They are only available in Microsoft 365, Excel 2021, or modern alternative spreadsheet applications like WPS Office.




