> For the complete documentation index, see [llms.txt](https://docs.valq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.valq.com/model/formula-functions/finance-functions/npv.md).

# NPV

The NPV function returns the net present value of an investment based on a discount rate and a series of future payments (negative values) and income (positive values).

### Syntax

NPV (Rate, value1,...valueN?) - > Number

### Arguments

<table><thead><tr><th width="148.33333333333331">Arguments</th><th width="224">Datatype</th><th>Description </th></tr></thead><tbody><tr><td>Rate</td><td>Number</td><td>The rate of discount </td></tr><tr><td>value1</td><td>Number, Node reference</td><td>The node that contains the order of cash flows for which you want to calculate the NPV. This is a required argument.</td></tr><tr><td>valueN?</td><td>Number, Node reference</td><td>The additional nodes that contains the order of cash flows for which you want to calculate the NPV. This is an optional argument </td></tr></tbody></table>

### Example

Consider the below example of a project with an initial investment of $10,000 and cash inflows of $4,000 for the subsequent four years. Discount rate is 12%. The objective is to evaluate the project by calculating NPV.

<table><thead><tr><th width="133">Periods</th><th align="right">0</th><th align="right">1</th><th align="right">2</th><th align="right">3</th><th align="right">4</th></tr></thead><tbody><tr><td><mark style="color:purple;">Initial Investment</mark></td><td align="right">-10000</td><td align="right">-</td><td align="right">-</td><td align="right">-</td><td align="right">-</td></tr><tr><td><mark style="color:green;">Cash Inflows</mark></td><td align="right">-</td><td align="right">4000</td><td align="right">4000</td><td align="right">4000</td><td align="right">4000</td></tr></tbody></table>

To achieve this, the following formula should be written in the \[NPV] node:

<mark style="color:blue;">**`NPV`**</mark>**`(12% ,`**<mark style="color:green;">**`[Cash Inflows]`**</mark>**`.`**<mark style="color:blue;">**`ALL_PERIODS`**</mark>**`)+`**<mark style="color:purple;">**`[Initial Investment]`**</mark>

We are including .ALL\_PERIODS in the formula so that it takes the value of the entire year's cash inflow rather a single period.

### Result

| NPV | 2149.40 |
| --- | ------- |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.valq.com/model/formula-functions/finance-functions/npv.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
