> 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/irr.md).

# IRR

The IRR function returns the internal rate of return for a series of positive and negative cash flows. Node references are also accepted as arguments.

### Syntax

IRR (values,Guess?) - > Number&#x20;

### Arguments

<table><thead><tr><th width="151">Arguments</th><th width="193">Datatype</th><th>Description</th></tr></thead><tbody><tr><td>values</td><td>Number, node reference</td><td>The node that contains the cash outflow and inflows for which you want to calculate the IRR. This is a required argument.</td></tr><tr><td>Guess?</td><td>Number    </td><td>A value that you guess is closest to the actual IRR value. This is an optional argument.</td></tr></tbody></table>

### Remarks

The argument should contain at least one positive and one negative value.

### 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. The objective is to evaluate the project by calculating IRR.

<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 \[IRR] node:

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

We are including[ .ALL\_PERIODS](https://docs.valq.com/model/formula-functions/finance-functions/pages/bd9R41FrVkmuCJPGQLmc#node-.all_periods) in the formula so that it takes the value of the entire year's cash inflow rather a single period.

### Result

<table data-header-hidden><thead><tr><th width="200.69230769230768" align="center">Column1</th><th width="155" align="center">Column2</th></tr></thead><tbody><tr><td align="center">IRR</td><td align="center">21.86%</td></tr></tbody></table>


---

# 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/irr.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.
