How to Break Circular Balance Calculations in Excel Using Dynamic Arrays
Question details
The user needs to calculate opening and closing balances for actual and forecast periods without creating circular reference errors.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Building a financial model or tracking balances where closing balances depend on opening balances, and subsequent opening balances depend on previous closing balances.
- Observed behavior
- The goal is to generate rolling balance calculations using modern array functions (such as LET, MMULT, and SCAN) to bypass the standard cell-by-cell circular dependency.
Ensure you are using a modern version of Excel (such as Microsoft 365 or Excel 2021) that supports dynamic array formulas and functions like LET, SCAN, and MMULT.
Calculate Closing Balances Using the SCAN Function
Use the SCAN function to iterate through periods and calculate closing balances dynamically, which inherently avoids circular loops.
The SCAN function is highly effective for running totals and balance accumulations. By calculating the entire array of closing balances first, you can easily derive the opening balances without triggering a circular reference.
Organize your data by keeping source data (inflows and outflows) separate from the presentation layer. Create a table or defined ranges for your periodic cash flows.
In your closing balance cell, write a SCAN formula that takes your starting balance as the initial value, and iterates over your net cash flow array (inflows minus outflows) to calculate the closing balance for each period.
Calculate the opening balances for each period by offsetting the resulting closing balances array backwards by one period, ensuring the first period uses the manual starting balance.

Accumulate Cash Flows Using the MMULT Function
Leverage MMULT to perform matrix multiplication, allowing you to accumulate inflows and outflows across multiple periods simultaneously.
Perform Dynamic Balance Calculations Easily in WPS Spreadsheet
WPS Spreadsheet fully supports dynamic array functions and advanced matrix formulas like MMULT, enabling you to build complex financial models without circular references. Enjoy a highly compatible and lightweight interface to streamline your data analysis.
- 1. Open your financial model: Launch WPS Spreadsheet and open your existing financial model or data table containing inflows and outflows.
- 2. Select the target cell: Click on the cell where you want your closing balance array to begin.
- 3. Input the array formula: Type your dynamic accumulation formula (e.g., using MMULT or other array techniques) referencing your cash flow ranges.
- 4. Spill the results: Press Enter to execute the formula. WPS Spreadsheet will automatically spill the calculated balances across the adjacent cells.

Frequently Asked Questions
What is a circular reference in Excel?
A circular reference occurs when a formula directly or indirectly refers to its own cell. In balance calculations, this commonly happens when a closing balance formula depends on an opening balance, while the next opening balance depends on the previous closing balance, creating an endless loop.
Why use dynamic arrays for balance calculations?
Dynamic arrays allow a single formula to process and output an entire array of values at once. By processing the periods simultaneously using functions like SCAN or MMULT, you break the sequential cell-by-cell dependency that triggers circular reference errors.
Can I use these dynamic array formulas in older versions of Excel?
Functions like SCAN, LET, and MAP are exclusive to Microsoft 365 and Excel 2021 or newer. For older versions, you can use the MMULT matrix accumulation method, which must be entered as a legacy array formula by pressing Ctrl+Shift+Enter.




