# 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: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

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

The question should be specific, self-contained, and written in natural language.
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.
