+ Reply to Thread
Results 1 to 5 of 5

Formula accomodating for the different number of days in a month

  1. #1
    Registered User
    Join Date
    09-05-2019
    Location
    Glasgow, Scotland
    MS-Off Ver
    2013
    Posts
    25

    Formula accomodating for the different number of days in a month

    Hey all,

    I have the problem of not having enough brain to work out how to turn these daily returns into monthly returns in an easy to perform fashion. The attached example is a segment of a pattern that goes on the same for a total of 294 publicly listed companies; in other words until row 764438.

    The formula here would be closing price at the end of the month take away the closing price of the start of the month, divided by the closing price at the start of each month. I am avoiding the use of opening price so as to make this all a bit easier to accomplish at the expense of a little accuracy.

    The biggest problem apparent to me making a repeatable formula here is that there are a different number of days between months.

    As such does anyone think it is at all possible to use the use the Close price column as the inputs for each monthly return, in a way that will be able to be copied down. To me, this sounds impossible, but then again people have shocked and humbled me here in the past. I am not expecting miracles don't worry :p this seems very improbable.

    Thank you and all the best,
    Attached Files Attached Files

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Formula accomodating for the different number of days in a month

    Assuming the month name is in K2, the year in L2, you can use

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,783

    Re: Formula accomodating for the different number of days in a month

    N3=IF($K$1<>"",SUMPRODUCT(($A$3:$A$7000=$K$1)*((MONTH($B$3:$B$7000)=MONTH(N$2))*(YEAR($B$3:$B$7000)=$M3)*($B$3:$B$7000<>"")*($I$3:$I$7000))),SUMPRODUCT((MONTH($B$3:$B$7000)=MONTH(N$2))*(YEAR($B$3:$B$7000)=$M3)*($B$3:$B$7000<>"")*($I$3:$I$7000)))

    copy down

    Select Symbol with yellow drop down month and year return for symbol


    with blank drop down month and year return only

  4. #4
    Registered User
    Join Date
    09-05-2019
    Location
    Glasgow, Scotland
    MS-Off Ver
    2013
    Posts
    25

    Re: Formula accomodating for the different number of days in a month

    Caracalla, your method is pretty ingenius and is very pretty on the eye to have that level of functionality and sorting. However, it makes my Excel unbearably slow when I implement it for over 294 stocks so unfortunately I cannot use it. I'm very thankful for your efforts though.

    Bob --- I tried your method and could not get it to work. I have attached my updated example worksheet. What's going wrong do you think?
    Attached Files Attached Files

  5. #5
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Formula accomodating for the different number of days in a month

    If you format M2 as percentage to 2 dec pl you will see it does work. BTW, no need to array-enter, it is not an array formula.

+ 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] Formula to calculate the number of days between dates (month wise)
    By arun.sj in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-22-2019, 12:51 PM
  2. Looking for help with excel formula to determine number of days in a month
    By sallysebern in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-11-2017, 03:44 PM
  3. [SOLVED] Formula to get number of days in a month
    By rizmomin in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-18-2017, 11:12 AM
  4. formula to get number of working days in a month based on criteria
    By aravindhan_31 in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 08-15-2016, 06:22 AM
  5. [SOLVED] A formula to calc total number of days elapsed between two dates within any given month
    By paul.a.evans in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-03-2014, 01:29 AM
  6. Replies: 8
    Last Post: 12-04-2013, 04:14 AM
  7. Replies: 4
    Last Post: 03-01-2012, 04:27 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