Homework+_1-Matlab+code - time of the last payment. FVAn =...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
VBA code for Excel that you may find useful to solve the homework assignment: Function PVAn(time As Double, rate As Double, Optional pmt As Double = 1) ' Computes the PV of a series of regular, equal payments. PVAn = pmt * (1 - (1 + rate) ^ (-time)) / rate End Function Function FVAn(time As Double, rate As Double, Optional pmt As Double = 1) ' Computes the value of a series of regular, equal payments, at the
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: time of the last payment. FVAn = pmt * ((1 + rate) ^ (-time) - 1) / rate End Function Function GrAn(time As Double, discount As Double, growthRate As Double, Optional pmt As Double = 1) ' Computes the PV of a series of regular, growing payments. GrAn = pmt * (1 - ((1 + growthRate) / (1 + discount)) ^ time) / (discount -growthRate) End Function...
View Full Document

Ask a homework question - tutors are online