Brian Dunning's FileMaker Custom Functions

NetPresentValue ( listOfPayments ; interestRate )

Same as Filemaker's native NPV() function - but payments do not need to be listed in a repeating field.

  Average rating: 4.0 (43 votes) Log in to vote

Michael Horak   Michael Horak
*COMMENT Visual Realisation
http://comment.cjb.net/

Share on Facebook Share on Twitter

  Sample input:
NetPresentValue ( List ( -2000; 600; 300; 500; 700; 400 ) ; 0.5 )
  Sample output:
156.9127744508813684

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Returns the net present value (NPV) of a series of unequal future payments (negative values) and income (positive values) occuring at regular intervals, assuming a fixed interestRate per interval.

Same as Filemaker's native NPV() function - but payments do not need to be listed in a repeating field.

Use this function to calculate NPV. For example, if you invest a sum of money and get paid back unequal amounts over a period of several years, you can use the NetPresentValue function to calculate the net present value of your investment.

Examples
NetPresentValue ( List ( -2000; 600; 300; 500; 700; 400 ) ; 0.5 ) returns 156.9127744508813684

NetPresentValue ( List ( Payments::Amount ) ; 0.1 ) returns 16758.3560487050685808 when the related records in the Payments table contain the amounts of -5000 (the initial investment), 10,000, 0, 10,000, and 10,000.

NOTE:
The data for these examples comes from Filemaker's help on the NPV() function - in order to demonstrate that the custom function returns the same results as the native one.

However, in the original text the negative amounts -2000 and -5000 are called "the initial payment" or "the initial investment". Unfortunately, this is quite incorrect: the first amount in the series is presumed to be paid AT THE END of the first period, not at the beginning of the entire transaction, as one would expect.

To calculate the correct NPV in a situation where the series of payments is preceded by an initial income (or vice versa), calculate the NPV of future payments only and subtract the initial income from the result, e.g.:

NetPresentValue ( List ( 600; 300; 500; 700; 400 ) ; 0.5 ) - 2000

returns 164.7584131734254368.

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Under construction. Email me your wish list for improvements.