## Description

Calculates the net present value of an investment based on future cashflows evenly spaced for a given time.

## Syntax

`NPV(Rate Metric, Payment Metric [, Compute All Cells] [, Ranking Dimension])`

Argument | Type | Dimensions | Description |
---|---|---|---|

(required) | Number or Integer | No Dimension or subset of Dimensions of Payment Metric | This is the discount rate. When defined on |

(required) | Number or Integer | Ranking Dimension | This represents the cashflow of the investment. Cashflow can be positive if there is income or negative if payments are needed. |

(optional) | boolean | No Dimension | Defines if the computation should be done on all If TRUE, starts at the first non empty If FALSE, only on the first non empty item of By default, set to FALSE. |

(optional) | Dimension (any kind) | Required when Defines the dimension used to perform the calculation on. |

## Return type

Type | Dimensions |
---|---|

Number | No Dimension, or subset of Payment Metric’s Dimensions |

If *Compute All Cells *is FALSE, will return for the first item of *Ranking Dimension* for which *Payment Metric was not empty *the sum of all future discounted payments.

If *Compute All Cells *is TRUE, will return for all items of *Ranking Dimension *the sum of future discounted payments.

In case you have a dataset where the payments & incomes happens on specific dates (and are not evenly spaced), you can not use the NPV formula. In that case, you need to use the XNPV formula.

The formula only considers the numeric values, and if there are blanks or text values, these would be ignored

The Pigment calculation of NPV excludes the initial investment and calculates the NPV for all the other future cash flows, if your cashflow starts during the same period of your initial investment it must be added. .

## Examples

Formula | Result | Description |
---|---|---|

`NPV('Single Variable','Investment Cashflow')` | Click on image to enlarge.
| This example uses a single discount rate in the Rate Metric that has no dimensions, which is why its listed under Total. The function returns the value in Jan 24, as this is when the first data is in the Payment Metric. However, you could also use this formula in a Metric without dimensions. |

`NPV('Variable Rates over time','Investment Cashflow')` | Click on image to enlarge.
| This example uses a |

`NPV('Single Variable','Investment Cashflow by Country',TRUE,Country)` | Click on image to enlarge. | This example uses a single discount rate in the Rate Metric that has no dimensions, which is why its listed under Total. The Payment Metric in this example is dimensioned by `Month` and `Country` , with Country being the ranking dimension. Compute all cells is set to `TRUE` so calculations are performed across all items in the Ranking Dimension, in this example `Country` . |

`NPV('Single Variable','Investment Cashflow by Country',FALSE,Country)` | Click on image to enlarge. | This example uses a single value |

## See also

Related articles: