such as daily, weekly, monthly, quarterly, yearly.

The following code computes the interest for any of the above compounding periods but is yearly based.

What I'd like to do is have any compounding period

but instead of the result requiring at least 1 being entered for years, that a month or day value can be entered. For example

if one has an annual rate of interest of 3 percent, compounded daily, but is earned only for a 3 month period, the returned result would be for that value.

Code:

`Public Function CompoundFV(Principal As Currency, IntRate As Single, CompPeriods As Integer, Years As Integer) As Currency`

'Forumula: Beginning Value * (1 + (interest rate/number of compounding periods per year))^(years * number of compounding periods per year) = Future Value

CompoundFV = Principal * (1 + (IntRate / CompPeriods)) ^ (Years * CompPeriods)

End Function