# RANGE

The RANGE function refers to the values of a node between the specified start and end periods. We can use this function to find the values of certain periods.

### Syntax

.RANGE(start\_index, end\_index) - > \[number]

### Arguments

<table><thead><tr><th width="188">Arguments</th><th width="172">Datatype</th><th>Description</th></tr></thead><tbody><tr><td>start_index</td><td>Number</td><td>The starting range/period value</td></tr><tr><td>end_index</td><td>Number</td><td>The ending range/period value</td></tr></tbody></table>

### Remarks

This function can only be used after refering a node for which this calculation needs to be done as shown below in the example.

### Example

Consider a scenario where we have interest payments for months Jan to Dec. Our objective is to calculate the interest paid in the months April to June.

| Periods                                              | Jan | Feb   | Mar   | Apr   | May   | Jun   | Jul   | Aug   | Sep   | Oct   | Nov   | Dec   |
| ---------------------------------------------------- | --- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- |
| <mark style="color:orange;">Interest payments</mark> | 0   | 78.37 | 74.06 | 69.71 | 65.33 | 60.91 | 56.46 | 51.96 | 47.43 | 42.86 | 38.26 | 33.61 |

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

<mark style="color:blue;">**`SUM`**</mark>**`(`**<mark style="color:orange;">**`[Interest payments]`**</mark>**`.`**<mark style="color:blue;">**`Range`**</mark>**`(4,6))`**

### Result

<table data-header-hidden><thead><tr><th width="125">Column1</th><th>Column2</th><th>Column3</th><th>Column4</th><th>Column5</th><th>Column6</th><th>Column7</th><th>Column8</th><th>Column9</th><th>Column10</th><th>Column11</th><th>Column12</th><th>Column13</th></tr></thead><tbody><tr><td>Range Interest payments</td><td>195.95</td><td>195.95</td><td>195.95</td><td>195.95</td><td>195.95</td><td>195.95</td><td>195.95</td><td>195.95</td><td>195.95</td><td>195.95</td><td>195.95</td><td>195.95</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/range-functions/range.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.
