How to Create Excel Dynamic Array Formulas for Start and End Dates
Question details
The user needs to generate a sequence of sequential start and end dates using a variable start date, end date, and term length using modern dynamic array formulas.
- Product
- Microsoft Excel 365
- Device & OS
- not provided
- Scenario
- Calculating rolling project milestones or billing terms where each new term's start date is determined by the duration of the preceding term.
- Observed behavior
- The user wants a clean, consistent formula approach using functions like SCAN and VSTACK to automatically generate the sequences without relying on the OFFSET function or experiencing inconsistent day subtractions.
Ensure you are using a spreadsheet software version that supports modern dynamic array functions (like SCAN, VSTACK, and LAMBDA), such as Microsoft Excel 365 or the latest version of WPS Office.
Use SCAN and VSTACK to Generate Date Sequences
Apply a combination of LAMBDA-based SCAN, VSTACK, and DROP functions to calculate precise start dates, and use spilled array addition for the end dates.
Dynamic arrays offer a cleaner and more efficient way to calculate sequential dates without the volatility of the OFFSET function. By using SCAN, the formula can iterate through a list of term lengths and keep a running total of the days to add to the initial start date.
Assume B1 holds your initial start date, and the range C7:C11 holds your list of term lengths in days. Adjust these references based on your actual worksheet layout.
In the cell where you want the first start date (for example, B7), enter the formula: =DROP(SCAN(B1,VSTACK(0,C7:C11),LAMBDA(a,b,SUM(a,b))),-1). This stacks a zero before your term lengths, calculates the running total using SCAN, and drops the final unnecessary iteration.
In the adjacent cell for your first end date, reference the spilled array from your start dates. Enter the formula: =B7#+C7:C11-1. The # symbol refers to the entire dynamic array originating from B7, which adds the term length and subtracts one day to calculate an inclusive end date.
Calculate Dynamic Arrays Easily with WPS Office
WPS Office Spreadsheet provides excellent support for advanced formulas and dynamic arrays. You can easily manage sequential date calculations, term lengths, and complex LAMBDA functions with full compatibility.
- 1. Open your spreadsheet in WPS: Launch WPS Office and open your .xlsx workbook containing the initial start dates and term lengths.
- 2. Apply the dynamic formulas: Select the target cell and input the SCAN and VSTACK formula to generate your spilled array of start dates.
- 3. Format the results as dates: Highlight the spilled results, right-click, select 'Format Cells', and choose your preferred Date format.

Frequently Asked Questions
Why does my dynamic array formula return a #SPILL! error?
A #SPILL! error occurs when a dynamic array formula needs to output multiple values, but there is existing data, spaces, or merged cells blocking the path. Clear the cells below the formula to resolve the error.
What does the # symbol mean in the end date formula?
The # symbol indicates a spilled range reference. For example, B7# refers to the entire dynamic array that originates in cell B7, allowing your end date formula to automatically expand or contract as the start date array changes.
Can I use the OFFSET function instead of SCAN to calculate dates?
While OFFSET can technically calculate sequential dates, it is a volatile function. This means it recalculates every time any change is made to the worksheet, which can significantly slow down performance on large files. Dynamic arrays using SCAN are non-volatile and much more efficient.
What if my term lengths are in months instead of days?
If your term lengths are in months, you cannot use simple addition. Instead, use the EDATE function in combination with SCAN. For example, you would iterate EDATE(start_date, months) within your LAMBDA function.




