View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ryguy7272 ryguy7272 is offline
external usenet poster
 
Posts: 2,836
Default UDF to Calculate YTM

If I go to this site:
http://www.moneychimp.com/articles/f.../fmbondytm.htm

Look at the Example:
YTM = 7.37%
The formula seems simple enough, so I tried to write my own function:


Function YieldMaturity(C, Y, n, P, R)

Dim sumall As Double
Dim j As Integer

sumall = 0
For j = 1 To n
sumall = sumall + ((C / (1 + Y) ^ n))
Next j

YieldMaturity = ((sumall + (P / (1 + Y) ^ n)) / R)

End Function

I use these inputs:
Nominal Coupon Rate = 70
Interest = 7%
Bond Price = 925.6
Redemption = 1000
Years = 4

Here's me calling the function:
=YieldMaturity(B7,B8,B11,B9,B10)



I get a result of 93.84%

Can someone please tell me what's wrong with my function? I suspect it is
the summing part.

Thanks!
--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.