How to Calculate Discounted Cash Flow and NPV with Dynamic Array Formulas in Excel
Question details
The user wants to calculate growing cash flows, discounted cash flows (DCF), and Net Present Value (NPV) using dynamic array formulas without building a separate calculation table.

- Product
- Excel 365
- Device & OS
- not provided
- Scenario
- Performing financial modeling and valuation that requires efficient NPV and DCF calculations using modern dynamic array functions.
- Observed behavior
- Needs a consolidated array formula approach to generate cash flow projections and discount them directly within a single cell.
Ensure you are using Excel 365, Excel for the web, or a modern spreadsheet software that supports dynamic array functions such as LET, SEQUENCE, SCAN, and LAMBDA.
Calculate the Sum of Discounted Cash Flows Using LET and SCAN
Use a combined dynamic array formula to project cash flows based on variable growth rates and discount them in one consolidated step.
The LET function allows you to assign names to calculation results, making complex formulas easier to read and process. By combining it with SCAN and LAMBDA, you can iteratively calculate growing cash flows over a sequence of years without needing a helper table.
Click on the cell where you want the total sum of the discounted cash flows to appear.
Ensure your initial amount, discount rate, and growth rate lookup tables are entered in the sheet (for example, discount rate in cell B1, lookup years in F4:I4, and lookup rates in F5:I5).
Type the following formula into the formula bar: =LET(initial,100000,dcfrate,B1,years,SEQUENCE(21,,0),lookupyear,F4:I4,lookuprate,F5:I5,cf,SCAN(initial,years,LAMBDA(amount,yr,amount*(1+LOOKUP(yr,lookupyear,lookuprate)))),dcf,cf/(1+dcfrate)^years,SUM(dcf))
Press Enter to execute the formula and instantly view the total discounted cash flow.

Calculate Net Present Value (NPV) Using Dynamic Arrays
Calculate the Net Present Value (NPV) by generating the future cash flow array internally and applying the standard NPV function.
Calculate Complex Financial Models with WPS Spreadsheet
WPS Office provides a powerful, free Spreadsheet tool that supports modern functions and advanced formulas. You can perform complex financial calculations like DCF and NPV seamlessly without switching software.
- 1. Open WPS Spreadsheet: Launch WPS Office and create a new Spreadsheet document.
- 2. Input financial data: Enter your initial investment, discount rates, and timeline variables into the designated cells.
- 3. Enter the advanced formula: Use the formula bar to type in your complex functions like NPV, LET, or SEQUENCE.
- 4. Evaluate the model: Press Enter to instantly process your financial models without needing intermediate helper columns.

Frequently Asked Questions
Why is my dynamic array formula returning a #SPILL! error?
A #SPILL! error occurs when a dynamic array formula needs to output results across multiple cells, but one or more of those adjacent cells are already occupied with data. Clear the blocking cells to allow the formula to spill correctly.
Can I use these DCF array formulas in older versions of Excel?
No, functions like LET, SCAN, LAMBDA, and SEQUENCE are dynamic array functions introduced in Excel 365 and Excel 2021. Older versions require traditional helper columns or VBA macros to achieve similar iterative calculations.
What is the difference between NPV and DCF in these formulas?
DCF (Discounted Cash Flow) refers to the individual present values of future cash flows, which are often summed up. NPV (Net Present Value) specifically calculates the present value of future cash flows and adds the initial cash outflow (investment at year 0) to evaluate total profitability.
How does the SCAN function work in this cash flow calculation?
The SCAN function iteratively applies a custom calculation (defined by the LAMBDA function) to each value in an array. In this specific scenario, it takes the previous year's cash flow, multiplies it by the respective growth rate, and projects the next year's cash flow, passing the new value forward continuously.




