+ Reply to Thread
Results 1 to 3 of 3

How to Create Finance Function

  1. #1
    Registered User
    Join Date
    08-18-2010
    Location
    CA,USA
    MS-Off Ver
    Excel 2007
    Posts
    1

    How to Create Finance Function

    Hey everyone I am new to programing in Excel and I do not know enough to wright a function that finds variance of a portfolio. This is what i have so far its messy and does not work.

    Function VARPORT(Sa,Wa,Sb,Wb,Sc,Wc,Sd,Wd,Se,We)

    va=VAR(Sa)
    vb=VAR(Sb)
    vc=VAR(Sc)
    vd=VAR(Sd)
    ve=VAR(Se)


    cab=Covar(va,vb)
    cac=Covar(va,vc)
    cad=Covar(va,vd)
    cae=Covar(va,ve)
    cbc=Covar(vb,vc)
    cbd=Covar(vb,vd)
    cbe=Covar(vb,ve)
    ccd=Covar(vc,vd)
    cce=Covar(vc,ve)
    cde=Covar(vd,ve)

    VAPORT=((Wa^2)*va)+((Wb^2)*vb)+((Wc^2)*vc)+((Wd^2)*vd)+((We^2)*ve)+(2*Wa*Wb*cab)+(2*Wa*Wc*cac)+(2*Wa*Wd*cad)+(2*Wa*We*cae)+(2*Wb*Wc*cbc)+(2*Wb*Wd*cbd)+(2*Wb*We*cbe)+(2*Wc*Wd*ccd)+(2*Wc*We*cce)+(2*Wd*We*cde)
    End Function

    The S stands for a list of stock returns.
    The W is what percentage of the portfolio is spent on that stock.
    The Covar and Var functions are to calculate the variance of each stock and the covariance between the five.
    The three letters are C for covariance and then what stock will be looked at.

    This is very confusing to me and I know I just made a big mess, can anyone help or point me int he right direction.
    Last edited by Bigbam21288; 08-18-2010 at 08:09 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: I need help making a finance function.

    Welcome to the forum.

    Please take a few minutes to read the forum rules, and then amend your thread title accordingly.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    08-18-2010
    Location
    Denver, CO
    MS-Off Ver
    Excel/Access 2010
    Posts
    8

    Re: How to Create Finance Function

    This add-in is a possible solution:
    http://www.tvmcalcs.com/blog/comment...or_Excel_2007/

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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