DCF in Excel Formula: NPV, XNPV and Full Model Setup

Excel does not have a built-in =DCF() function, so you write a DCF in Excel formula using =NPV(rate, value1, [value2], ...) for equal annual periods, =XNPV(rate, values, dates) for exact calendar dates, or manual cell discounting with =CF/(1+WACC)^t summed across your forecast. Add the present value of your terminal value to the present value of explicit cash flows to find firm value, an approach used by 78.8% of professional equity analysts in the CFA Institute 2026 Curriculum (citing Pinto, Robinson, and Stowe 2019). Keep any Period 0 cash flow outside =NPV(), because Excel discounts the first cell inside the function by one full period.

Updated

Three ways to write an Excel DCF formula

Intrinsic value today equals expected future cash flows discounted back at a required rate of return: V0 = sum of CFt / (1 + r)^t. Because Microsoft Excel has no native =DCF() command, you build a DCF formula in Excel in one of three ways.

For annual corporate forecasts, =NPV() discounts a row of projected cash flows in one cell. For deal models with a stub period or mid-year closing date, =XNPV() discounts each flow on exact calendar days. For banking and private equity modeling tests, analysts often write an explicit discount factor row using =1/(1+WACC)^t and multiply each column separately so reviewers can audit every year.

Do not confuse =NPV() with =PV(rate, nper, pmt, fv, type), where fv and type are optional arguments. Microsoft Support documentation states that PV requires constant periodic payments over an annuity (with type set to 0 for end-of-period or 1 for beginning-of-period payments, and fv assumed to be 0 when omitted). Corporate free cash flows change every year, which rules out PV for standard DCF analysis in Excel.

Comparison of Excel present value formulas for DCF valuation

Comparison of Excel present value formulas for DCF valuation
MethodExact Excel SyntaxTiming AssumptionBest Used For
Periodic NPV=NPV(WACC, C16:G16) + PV_of_TVEqual intervals at period endAnnual corporate forecasts starting Period 1
Exact-date XNPV=XNPV(WACC, B16:G16, B10:G10) + PV_of_TVExact calendar dates on a 365-day yearDeal models with stub periods or irregular dates
Explicit row discounting=SUMPRODUCT(C16:G16, C17:G17) + PV_of_TVPeriod-end (t) or mid-year (t, 0.5) per columnModeling tests and mid-year convention models
Constant annuity PV=PV(rate, nper, pmt, fv, type)Identical payment every period (type 0 or 1)Fixed-payment loans, leases, or level annuities

NPV vs XNPV and the Period 0 timing trap

The most common mistake in a DCF Excel formula comes from how =NPV(rate, value1, [value2], ...) treats its first cell. Microsoft Support states that an NPV investment begins one period before the date of the value1 cash flow, so Excel divides the first number inside the parentheses by (1 + rate)^1. The function accepts 1 to 254 cash flow arguments, requires equally spaced end-of-period intervals, and ignores empty cells, logical values, or text inside a range.

If your model includes an upfront outlay today (Period 0), keep Period 0 outside the parentheses: =NPV(rate, Year1:Year5) + Year0_Outflow. In Microsoft's second NPV example, an 8% (0.08) annual rate applied to an initial cost of -$40,000 today and five annual inflows ($8,000, $9,200, $10,000, $12,000, and $14,500) using =NPV(A2, A4:A8)+A3 returns $1,922.06. By our calculation from that example data, placing -$40,000 inside =NPV(0.08, A3:A8) shifts every cash flow back one extra year and returns $1,779.69, understating net present value by $142.38 (or 7.4%).

When cash flows do not fall one full year apart, use =XNPV(rate, values, dates), which discounts payments after the start date on a 365-day year. The first date marks Period 0 and is not discounted. In Microsoft's XNPV example, discounting -$10,000 on 1/1/2008 and inflows of $2,750 on 3/1/2008, $4,250 on 10/30/2008, $3,250 on 2/15/2009, and $2,750 on 4/1/2009 at a 9% (.09) rate via =XNPV(.09, A2:A6, B2:B6) returns $2,086.65.

XNPV requires the values range to contain at least one positive value and at least one negative value.

Institutional financing agreements rely on these exact-date functions for the same reason. A US SEC Exhibit 10.3 filing dated September 11, 2024 (the Fifth Amendment to the Revenue Interest Financing Agreement between Liquidia Technologies, Inc. and Healthcare Royalty Partners IV, L.P.) requires Excel's XIRR function (where XNPV equals 0) to calculate true-up payments yielding an 18% internal rate of return on tranches funded before that date ($32,500,000 initial funding, $10,000,000 on July 27, 2023, and $25,000,000 on January 4, 2024) and 16% on the $32,500,000 tranche tendered on or after that date.

  • Use =NPV(WACC, Year1_FCF:Year5_FCF) only when Year 1 sits one full period from your valuation date.
  • Use =XNPV(WACC, All_Values, All_Dates) whenever your valuation date falls mid-year.

Free cash flow, WACC, and terminal value formulas

A DCF formula Excel setup is only as sound as its cash flow row and discount rate. In the CFA Institute 2026 Curriculum (citing Pinto, Robinson, and Stowe 2019), among analysts using DCF valuation, 86.9% use a discounted free cash flow model, 35.1% use a dividend discount model, and 20.5% use residual income. Analysts use Free Cash Flow to the Firm (FCFF, or unlevered free cash flow) about twice as often as Free Cash Flow to Equity (FCFE, or levered free cash flow).

Do not discount raw net income, EBIT, EBITDA, or cash flow from operations (CFO), which double-count or omit capital spending and working capital investments. Match each cash flow stream to its discount rate: discount FCFF at the weighted average cost of capital (WACC) to find operating firm value, or discount FCFE at the required return on equity (r) to find equity value directly.

Two-stage corporate models pair explicit annual cash flows with a Terminal Value at Year n. Under the Gordon Growth model, cash flows grow forever at constant rate g (requiring WACC strictly above g): =Final_Year_FCFF * (1 + g) / (WACC, g). Analysts also use market multiples (used by 92.8% of equity analysts in the survey cited above), and in multistage dividend discount models terminal stock value is sometimes found by applying a P/E multiplier to forecasted EPS as of the terminal date.

Terminal Value is estimated as of the end of Year n, so you must discount Terminal Value back n periods using =Terminal_Value / (1 + WACC)^n. Add discounted Terminal Value to discounted explicit FCFF to get operating firm value, add non-operating assets such as excess cash and marketable securities to find total firm value, subtract non-common-stock capital such as market value of debt and preferred stock to get common equity value, and divide by the number of outstanding shares.

  • FCFF from EBIT: =EBIT * (1, Tax_Rate) + Depreciation, CapEx, Change_in_NWC, written as EBIT(1, Tax rate) + Dep, FCInv, WCInv.
  • FCFF from EBITDA: =EBITDA * (1, Tax_Rate) + (Depreciation * Tax_Rate), CapEx, Change_in_NWC.
  • FCFF from Net Income or CFO: =Net_Income + Non_Cash_Charges + Interest * (1, TaxRate), CapEx, Change_in_NWC, or =CFO + Interest * (1, TaxRate), CapEx.
  • FCFE from FCFF: =FCFF, Interest * (1, Tax rate) + Net_Borrowing.
  • WACC formula: =(MV_Debt / (MV_Debt + MV_Equity)) * Cost_of_Debt * (1, Effective_Tax_Rate) + (MV_Equity / (MV_Debt + MV_Equity)) * Cost_of_Equity, where Cost_of_Equity is the required rate of return on equity.
  • Equity Value and Share Price bridge: =(Operating_Firm_Value + Excess_Cash, Total_Debt, Preferred_Stock) / Outstanding_Shares.

Worked example: 5-year Excel DCF model with cell coordinates

The 5-year unlevered model below for Harborline Logistics shows how every cell connects on one sheet. This is an invented example written by our team, with every formula verified.

Inputs sit in column B (rows 4 to 9) and explicit forecasts run across columns C to G for Years 1 to 5. In cell B20, =NPV(B4, C16:G16) returns $134.30 million ($134.3006 million unrounded), matching the manual present value row sum =SUM(C17:G17) before two-decimal display rounding.

Invented 5-year Excel DCF model for Harborline Logistics ($ in millions, except per-share data)

Invented 5-year Excel DCF model for Harborline Logistics ($ in millions, except per-share data)
CellLine ItemExcel Formula or InputOutput
B4WACC (discount rate)0.1010.0%
B5Perpetual growth rate (g)0.0252.5%
B6Effective tax rate0.2525.0%
B7Excess cash and marketable securities25.0"$25.00"
B8Market value of total debt80.0"$80.00"
B9Diluted shares outstanding (millions)10.010.00
C11:G11Projection period (t)1, 2, 3, 4, 5Years 1 to 5
C12:G12EBIT40.0, 48.0, 56.0, 64.0, 72.0"$40.00 to $72.00"
C13:G13Depreciation and amortization8.0, 9.0, 10.0, 11.0, 12.0"$8.00 to $12.00"
C14:G14Capital expenditures (FCInv)10.0, 11.0, 12.0, 13.0, 14.0"$10.00 to $14.00"
C15:G15Change in net working capital (WCInv)3.0, 4.0, 4.0, 4.0, 2.0"$3.00 to $2.00"
C16:G16Unlevered free cash flow (FCFF)=C12*(1-$B$6)+C13-C14-C15"$25.00, $30.00, $36.00, $42.00, $50.00"
C17:G17PV of each year's FCFF=C16/(1+$B$4)^C11"$22.73, $24.79, $27.05, $28.69, $31.05"
G18Terminal Value in Year 5 (Gordon Growth)=G16*(1+$B$5)/($B$4-$B$5)"$683.33"
B19PV of Terminal Value=G18/(1+B4)^G11"$424.30"
B20Operating Firm Value (Enterprise Value)=NPV(B4, C16:G16)+B19"$558.60"
B21Implied Equity Value=B20+B7-B8"$503.60"
B22Implied Value per Share=B21/B9"$50.36"
Mid-year convention formula in Excel

Standard =NPV() requires cash flows to occur at the end of each period. To discount annual cash flows in our Harborline Logistics spreadsheet at the midpoint of each period instead of year-end, subtract 0.5 from each period exponent in the manual present value row by entering =C16/(1+$B$4)^(C11-0.5) across cells C17:G17, or multiply the periodic NPV formula by half a period of compounding using =NPV(B4, C16:G16)*(1+B4)^0.5.

By our calculation on the invented Harborline Logistics forecast above, shifting the exponents from 1, 2, 3, 4, and 5 to 0.5, 1.5, 2.5, 3.5, and 4.5 lifts the present value of the five explicit cash flows from $134.30 million ($134.3006 million unrounded) to $140.86 million ($140.8557 million unrounded).

When Terminal Value in cell G18 represents value as of the end of Year 5, keep cell B19 discounted across all five full periods with =G18/(1+B4)^G11.

Automating a 2-way DCF sensitivity table in Excel

Gordon Growth values are very sensitive to the assumed growth rate and required rate of return, making sensitivity analysis a core check in FCFF and FCFE valuations. You can build a dynamic 5-by-5 sensitivity grid on our Harborline Logistics sheet directly with mixed cell references and =NPV():

  • Enter five perpetual growth rates across row 25 (cells C25:G25: 1.5%, 2.0%, 2.5%, 3.0%, and 3.5%) and five WACC rates down column B (cells B26:B30: 8.0%, 9.0%, 10.0%, 11.0%, and 12.0%).
  • In cell C26, enter =(NPV($B26, $C$16:$G$16) + ($G$16*(1+C$25)/($B26-C$25))/(1+$B26)^$G$11 + $B$7, $B$8)/$B$9 so $B26 locks column B for WACC and C$25 locks row 25 for g.
  • Copy cell C26 across C26:G30 to calculate all 25 per-share valuations in one step.
  • Confirm the center cell E28 (10.0% WACC and 2.5% growth) matches $50.36 in cell B22, with grid outputs spanning from $34.62 (12.0% WACC, 1.5% growth) to $87.00 (8.0% WACC, 3.5% growth).
Troubleshooting Excel errors and pre-submission checklist

Fix broken formulas directly rather than hiding them inside =IFERROR(). First, #DIV/0! or a negative terminal value appears in Gordon Growth when WACC is less than or equal to g, violating r above g. Second, XNPV and XIRR return #VALUE! if any date is stored as text instead of an Excel serial number (Excel counts days from 1 on January 1, 1900, making January 1, 2008 serial number 39448), so build date headers with =DATE(year, month, day).

Third, XNPV and XIRR return #NUM! if a date precedes the start date, if values and dates have different cell counts, or if all flows share the same sign. Both IRR and XIRR default their optional guess argument to 0.1 (10 percent), with IRR cycling up to 20 tries to reach 0.00001 percent accuracy and XIRR cycling up to 100 tries to reach 0.000001 percent accuracy before returning #NUM!. Fourth, circular references trigger if WACC links to DCF-implied equity value instead of market or target weights, or if interest links to average debt.

Before turning in a spreadsheet test, walking through valuation questions in investment banking technical interviews, or solving buyout prompts in consulting case study examples, run this checklist written by our team:

  • Period 0 outside NPV: Confirm =NPV() starts at Year 1, never Year 0.
  • Terminal Value discounted: Confirm Year n Terminal Value is divided by (1 + WACC)^n.
  • Matched numerator and rate: Confirm FCFF pairs with WACC, or FCFE pairs with cost of equity.
  • Working capital sign: Confirm an increase in net working capital is subtracted as a cash outflow.
  • Locked input references: Confirm $B$4 and $B$6 carry dollar signs before copying across columns.
  • Terminal share check: Check PV of Terminal Value as a share of firm value ($424.30 / $558.60 = 76.0% in our example) alongside the implied exit EBITDA multiple.

From Microsoft Support: NPV function, Microsoft Support: XNPV function, Microsoft Support: PV function, Microsoft Support: IRR function, Microsoft Support: XIRR function, CFA Institute: Free Cash Flow Valuation (2026 Curriculum), CFA Institute: Discounted Dividend Valuation (2026 Curriculum) and US SEC EDGAR: Liquidia Technologies Exhibit 10.3 (September 11, 2024).

1 practice question and sample answer

Say your answer out loud first, then read the sample answer.

Practice question

  1. Walk me through how you discount cash flows in an Excel DCF model, and explain what goes wrong if you highlight Year 0 through Year 5 inside =NPV().

    Sample answer. Example answer written by our team. The applicant is invented. In an unlevered Excel DCF, I first project five to ten years of Free Cash Flow to the Firm by taking EBIT times one minus the tax rate, adding back depreciation and amortization, and subtracting capital expenditures and increases in net working capital. For standard annual periods, I discount Year 1 through Year 5 at WACC with =NPV(WACC, Year1:Year5), or I write an explicit discount factor row so I can apply a mid-year convention with t minus 0.5. When a deal has a stub period or irregular dates, I use =XNPV(WACC, values, dates), which discounts on a 365-day calendar. You never highlight Year 0 inside =NPV() because Excel assumes the first cell in the range arrives one full period from today. Including Year 0 shifts every cash flow back an extra year and understates value. Finally, I compute Terminal Value via Gordon Growth or an exit multiple, discount it back from Year 5, add excess cash, subtract debt, and divide by diluted shares.

    It pairs FCFF with WACC, explains the exact mechanical Period 0 error in =NPV(), contrasts =NPV() with =XNPV() and mid-year discounting, and completes the equity bridge cleanly.

Practice the interview, out loud

Soreno's AI interviewer asks banking fit and technical questions, follows up on your answers and scores them.

Questions people ask

Is there a built-in =DCF() formula in Excel?

No, Excel has no =DCF() function. You calculate a DCF using =NPV(rate, value1, [value2], ...) for equal periods, =XNPV(rate, values, dates) for exact calendar dates, or manual cell formulas with =CF/(1+WACC)^t.

What is the difference between NPV and XNPV in an Excel DCF?

Microsoft Support notes that NPV assumes cash flows occur at equal intervals at the end of each period. XNPV discounts cash flows on exact calendar dates using a 365-day year, making it accurate for stub periods and irregular schedules.

Why do you keep Year 0 outside Excel's NPV formula?

Excel's NPV calculation begins one period before the date of value1, discounting the first cell inside =NPV() by one full period. Any Period 0 cash flow today must be added outside the parentheses as =NPV(rate, Year1:Year5) + Year0.

Should you discount FCFF at WACC or FCFE at cost of equity?

In the CFA Institute 2026 Curriculum, discounting Free Cash Flow to the Firm (FCFF) at WACC gives total firm value before subtracting debt, and analysts use FCFF about twice as often as FCFE. Discounting Free Cash Flow to Equity (FCFE) at the required return on equity gives equity value directly.

Can you use Excel's PV function for DCF analysis?

Rarely, because =PV(rate, nper, pmt, fv, type) requires constant periodic payments over the life of an annuity. Corporate free cash flows change each year, so you need =NPV(), =XNPV(), or explicit discount factors.

Keep going