+ Reply to Thread
Results 1 to 3 of 3

Writing macros to calculate mutual fund performances

  1. #1
    Registered User
    Join Date
    01-02-2016
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    2

    Writing macros to calculate mutual fund performances

    Hi All,

    I am new to excel macros and have NO knowledge in programming!Any help/answers would be much appreciated.

    Herewith I have attached an excel workbook. One worksheet represents one mutual fund. It contains stocks held monthly by this fund for 2003 - 2014 period. I have around 450 such mutual funds. Basically I need to calculate profits and stocks for each mutual fund.

    • The first column (A) "ticker" shows the id for each stock and the worksheet is sorted by this first, and then by date.
    • Do not worry about columns B, D and E.
    • Column F shows the units bought by the fund, if any, at the particular date (date = Column D).
    • Column G shows the units sold by the fund, if any, at the particular date.
    • Column H shows the prices at which purchases and sales happened.
    • The columns for which I need macros are I, J and K.
    • I shows profits for a sale, J shows stock (number of stocks) and K shows the average price of the stock. This needs to be calculated based on FIFO (First in First Out) and Average Price methods.

    The Excel workbook I have attached herewith have two worksheets where these have been calculated manually on the two methods. I have attached a word doc (FIFO&AVCO-Explains) which describes the two methods with a simple example as the equations in the worksheet at first glance could be confusing. There's another word doc (FIFO&AVCO-WithRealData) which also describes the equations I have used in the worksheets.

    NOTE: The columns for which I need macros are I, J and K.the formulas in those columns(in RED) are only to show how calculation works.(you clear anytime)

    Thanks in advance.

    FIFO&AVCO-WithRealData.docx
    FIFO&AVCO-Explains.docx
    Book1.xlsx

    PS Happy New Year 2016 to all members of the forum
    Last edited by danukachathu; 01-02-2016 at 07:20 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Writing macros to calculate mutual fund performances

    I am trying to follow the logic - and se3quence - of your calcs, and not succeeding too well

    Take column I...
    You have a bunch of 0's (becasue you had no sales?)
    Then you have, spread about in that column, a bunch of disparate formulas...
    I5=(H5-H3)*G5
    I9=((H9-H3)*(F3-G5))+((H9-H4)*F4)+((H9-H6)*9)
    I11=((H11-H6)*(F6-9))+((H11-H7)*F7)+((H11-H8)*F8)
    I24=(H24-H19)*G24
    I25=((H25-H19)*(F19-G24))+((H25-H20)*F20)+((H25-H21)*F21)+((H25-H22)*F22)+((H25-H23)*F23)
    I see no real progression/logic in those. Sometimes you use references, other times, hard-coded numbers...someimes a simple formula, others, a long nested formula
    While these must make perfect sense to you (and are probably just calcs you made up to show the answers), most of us will probably have no clue what you are doing

    Column K has some equally mistifying calcs...
    K3=(F3*H3)/J3
    K4=((F3*H3)+(F4*H4))/J4
    K5=(((F3-G5)*H3)+(F4*H4))/J5
    K6=(((F3-G5)*H3)+(F4*H4)+(F6*H6))/J6


    If you can walk me through the sequence and the calc, I may be able to help
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    01-02-2016
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    2

    Re: Writing macros to calculate mutual fund performances

    Hi Ford,

    Thanks for the super quick response.

    I forgot to mention it.

    The columns for which I need macros are I, J and K.

    the formulas in those columns(in RED) are only to show how calculation works.(you clear anytime)

    Thanks,
    Dan

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] rank employees based on performances
    By tlacloche in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 10-10-2013, 10:53 AM
  2. Excel - Get stock / mutual fund quotes issue ...
    By friedboudinball in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-02-2012, 12:54 PM
  3. Automatically retrieve Mutual Fund Data
    By Habanero Time in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-19-2012, 09:00 PM
  4. New to writing macros
    By ynnod in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 09-06-2007, 10:20 PM
  5. [SOLVED] Writing Macros
    By sportsbarn in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-07-2006, 05:45 AM
  6. Writing Macros
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-08-2006, 10:45 PM
  7. [SOLVED] Computing Mutual Fund Diversification
    By [email protected] in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-16-2006, 09:10 AM
  8. [SOLVED] How to calculate CAGR for mutual fund performance using XIRR
    By Dick in SL in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-06-2006, 06:10 PM

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