# RangeNPV - Script and chart function

RangeNPV() returns the net present value of an investment based on a discount rate and a series of future periodic payments (negative values) and incomes (positive values). The result has a default number format of money.

For cash flows that are not necessarily periodic, see [RangeXNPV - Script and chart function](https://help.qlik.com/en-US/sense/November2025/Subsystems/Hub/Content/Sense_Hub/Scripting/RangeFunctions/RangeXNPV.htm).

Syntax:

RangeNPV(discount\_rate, value[,value][, Expression])

Return data type: numeric

Arguments

| Argument | Description |
| --- | --- |
| discount\_rate | The interest rate per period. |
| value | A payment or income occurring at the end of each period. Each value<br>may be a single value or a range of values as returned by an inter-record<br>function with a third optional parameter. |
| Expression | Optional expressions or fields containing the range of data to be measured. |

Limitations:

Text values, NULL values and missing values are disregarded.

| Examples | Results |
| --- | --- |
| `RangeNPV(0.1,-10000,3000,4200,6800)` | Returns<br>1188.44 |
| Add the example script to your app and run it. To see the result, add the fields listed in the results column to a sheet in your app.<br><br>`RangeTab3:`<br>`LOAD *,`<br>` recno() as RangeID,  `<br>`RangeNPV(Field1,Field2,Field3) as RangeNPV;`<br>`LOAD * INLINE [`<br>`Field1\|Field2\|Field3`<br>`10\|5\|-6000`<br>`2\|NULL\|7000`<br>`8\|'abc'\|8000`<br>`18\|11\|9000`<br>`5\|5\|9000`<br>`9\|4\|2000`<br>`] (delimiter is '\|');` | <table> <colgroup><col> </colgroup> <tr> <td>The resulting table shows the returned values of <span>RangeNPV</span> for each of the records in the table.</td> </tr> <tr> <td> <div><div><table> <colgroup><col> <col> </colgroup> <tr> <td>RangeID</td> <td>RangeNPV</td> </tr> <tr> <td>1</td> <td>$-49.13</td> </tr> <tr> <td>2</td> <td>$777.78</td> </tr> <tr> <td>3</td> <td>$98.77</td> </tr> <tr> <td>4</td> <td>$25.51</td> </tr> <tr> <td>5</td> <td>$250.83</td> </tr> <tr> <td>6</td> <td>$20.40</td> </tr>  </table></div></div> </td> </tr>  </table> |

## Learn more

* [Inter-record functions](https://help.qlik.com/en-US/sense/November2025/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/InterRecordFunctions/inter-record-functions-charts.htm)