# 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/node-properties/node-properties-explanation#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>
