How to Extend the Last Actual Value Across Forecast Periods in Excel
Question details
The user wants to carry the most recent actual value forward across future forecast periods for multiple rows in a two-dimensional array, adjusting for different final actual periods.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Building a financial forecasting model where actuals end at different periods for different entities, requiring future periods to inherit the last known actual value dynamically.
- Observed behavior
- The goal is to automatically populate empty forecast columns with the last available actual value using a single dynamic formula rather than manual cell referencing.
Ensure your data table is organized with clearly defined actuals and forecast columns, and verify that you are using a version of Excel that supports dynamic array functions such as LET, SCAN, and BYROW.
Use XMATCH and INDEX to Find and Carry Forward the Last Actual Value
This method isolates the last actual column using XMATCH in a reverse search and retrieves its value with the INDEX function, making it ideal for arrays with clear actual flags.
This solution utilizes the LET function to define variables, keeping the formula clean and efficient. It searches backwards through the rows to find the most recent actual period.
Use the formula BYROW(G6:N8, LAMBDA(r, XMATCH(1, r, , -1))) to search the flag rows in reverse (-1) and locate the column index of the last flagged actual period for each row.
Pass the located column indices into the INDEX function using INDEX(G12:N14, SEQUENCE(ROWS(G12:N14)), lastCols) to pull the corresponding actual values from your data array.
Combine these elements within a LET function. Use an IF statement to check if the current period is greater than the last actual period; if so, return the last actual value. Wrap the logic in IFNA to handle rows that might not have an actual flag.

Carry Forward Values Using SCAN and MAP Functions
An alternative dynamic array approach that iterates through the forecast array and accumulates the last valid actual value sequentially.
Effortlessly Handle Complex Forecasting with WPS Spreadsheet
WPS Spreadsheet fully supports modern dynamic array functions including LET, SCAN, and XMATCH, allowing you to build robust financial models and forecast arrays seamlessly.
- 1. Open your forecast workbook: Launch WPS Spreadsheet and open your existing Excel (.xlsx) financial forecasting file.
- 2. Enter the dynamic formula: Click on the starting cell of your forecast output range and type your LET or SCAN formula to carry the actual values forward.
- 3. Calculate and format: Press Enter to allow the dynamic array to spill across all necessary forecast rows and columns, then apply your preferred currency or accounting number formats.

Frequently Asked Questions
Why does XMATCH with -1 search mode return an error?
The -1 argument in XMATCH instructs it to search from last to first. If it returns an #N/A error, it means the lookup value (such as your actual period flag) does not exist in that specific row. You can wrap your formula in IFNA to handle this scenario gracefully.
Can I use these dynamic array formulas in older versions of Excel?
Functions like LET, SCAN, MAP, and BYROW are only available in Microsoft 365 and Excel 2021 or later. For older versions, you will need to rely on traditional formulas like LOOKUP(2, 1/(range<>""), range) and drag them manually across your forecast cells.
How do I apply a growth rate to the carried-forward actual values?
You can integrate a growth multiplier within the SCAN function. Instead of simply returning the accumulated value (acc) for forecast periods, use a formula like acc*(1+growth_rate) inside your LAMBDA function.
Why use LET instead of writing the formula directly?
The LET function allows you to define variables within your formula, meaning Excel only calculates repetitive parts (like identifying the last column) once. This significantly improves calculation performance and makes complex forecasting formulas easier to read.




