Calculation Issues

How to Calculate Discounted Cash Flow and NPV with Dynamic Array Formulas in Excel

John WilsonJohn Wilson Nov 10, 2026 869 views

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.

How to Calculate Discounted Cash Flow and NPV Using Excel Dynamic Array Formulas
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.
Before you start

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.

Solution 1Recommended

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.

1
Select the target cell

Click on the cell where you want the total sum of the discounted cash flows to appear.

2
Set up your variables

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).

3
Enter the dynamic array formula

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))

4
Calculate the result

Press Enter to execute the formula and instantly view the total discounted cash flow.

Calculate the Sum of Discounted Cash Flows Using LET and SCAN
Formula Breakdown: The SCAN function applies the LAMBDA function iteratively to grow the initial cash flow, while the SEQUENCE function automatically creates the required timeline array.
Advanced Financial Modeling in WPS

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. 1. Open WPS Spreadsheet: Launch WPS Office and create a new Spreadsheet document.
  2. 2. Input financial data: Enter your initial investment, discount rates, and timeline variables into the designated cells.
  3. 3. Enter the advanced formula: Use the formula bar to type in your complex functions like NPV, LET, or SEQUENCE.
  4. 4. Evaluate the model: Press Enter to instantly process your financial models without needing intermediate helper columns.
Fully compatible with Microsoft Excel formulas, including financial and complex array functions.Free and lightweight alternative for executing advanced financial modeling.Clean, familiar user interface ensuring a zero-learning-curve migration.
microsoft office alternative - wps office

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.