I try to create my own function to calculate remaining periods on annuity mortgage. It goes like this:
Function perioder()However, when I call it in my worksheet, it only returns the #Value! error. Being new to Excel VBA programming, I can't figure out what is wrong.
Dim PV As Double
Dim r As Double
Dim P As Double
Dim perioder As Double
perioder = Log(1 - ((PV * r) / P) ^ -1) / Log(1 + r)
End Function
Can anybody please help me?
Thanx a lot!
Bookmarks