DURATION function

exc005

New Member
Joined
Jul 4, 2017
Messages
1
Hi all

DURATION function : Returns the Macauley duration for an assumed par value of $100. Duration is defined as the weighted average of the present value of the cash flows and is used as a measure of a bond price's response to changes in yield.

DURATION(settlement, maturity, coupon, yld, frequency, [basis])

it is usually calculated by excel ; for example

B7=DURATION(B1,B2,B3,B4,B5,B6)

526223d1499192962-duration-function-iepum.png



but what i am trying to do , is to customize Duration function with vba editor

526226d1499196153-duration-function-2017-07-04_202126.png


i think Excel uses this formula as explained in Wikipedia for calculation Macauley duration.

526227d1499196377-duration-function-ol1om.png


:crash: the problem is i find difficulty to write this function in vba to calculate Duration like Excel
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Forum statistics

Threads
1,224,823
Messages
6,181,179
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top