+ Reply to Thread
Results 1 to 3 of 3

Linking Returns

  1. #1
    Registered User
    Join Date
    08-31-2007
    Posts
    7

    Linking Returns

    ** I may have original posted this in the wrong forum.


    I'm having trouble coming up with a function that would accomplish the math equation below.

    _______________________

    Returns are:

    5%, 10%, 15%, 20%

    _______________________


    The equation to link the returns is:

    (1+5%)*(1+10%)*(1+15%)*(1+20%)-1

    _______________________


    No matter what I tried I just can't get the code to work. Should I us an Array or Just a Range, For Next? Any help would be appreciated.


    Function LINKADD(rRange As Range)

    Dim i As Variant
    Dim rLink As Variant
    Dim rLink2 As Variant


    For Each i In rRange

    rLink = rLink + 1
    rLink2 = rLink * rLink

    Next i

    LINKADD = rLink2 - 1


    End Function
    Last edited by psd122; 08-31-2007 at 03:32 PM.

  2. #2
    Forum Contributor
    Join Date
    07-05-2007
    Location
    Lexington, MA
    Posts
    302
    Try this:
    Please Login or Register  to view this content.
    (Your function didn't use the values in i)
    FrankBoston is the pen name for Andrew Garland, Lexington MA

  3. #3
    Registered User
    Join Date
    08-31-2007
    Posts
    7
    Thanks Frank. Your code worked perfectly, I'll to work at understanding arrays and such. They always give me problems. Thanks again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1