+ Reply to Thread
Results 1 to 8 of 8

daily average from months dated back to 2008

  1. #1
    Registered User
    Join Date
    03-12-2013
    Location
    Krakow
    MS-Off Ver
    Excel 2003
    Posts
    5

    daily average from months dated back to 2008

    my problem:
    In 1st worksheet I have column with dates from 01/01/2009 up to today. Few next columns are with statistics on daily basis, from monday to friday. Now, in other worksheet I want to make a other statistics provided monthly data dating back until 2009. I have already had first columnt in the 2nd worksheet with the sum of all the daily values, providing one monthly value. Now I would like to do e.g daily average from the monthly values ( I want to divide the sum of daily values by the number of business days in that month). Now my question is:
    How can I make a formula that would automatically change the month from the 1st to the 30/31st of the month and then, divide the sum, by COUNTA( from that same group of cells)
    COUNTA gets the number of cells which are not empty. In my case saturdays and sundays are empty.
    Thanks in advance for any help.
    M

  2. #2
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: daily average from months dated back to 2008

    Working with dates is always something I dread. Not sure of your layout, as I may have a different solution, but to answer your specific question:
    =EOMONTH(date,0) will give you the last day of the month for 'date'. If you need further help, I recommend a posting of your workbook, as there are likely many ways to solve this (SUMIF, COUNTIF, SUMPRODUCT, etc.)
    Pauley
    --------
    If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).

  3. #3
    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,939

    Re: daily average from months dated back to 2008

    Hi and welcome to the forum

    i would suggest you upload a sample work book, (all sensitive data removed), showing what data you are working with, a few examples of what your expected outcome is, and how you arrived at that
    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    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

  4. #4
    Registered User
    Join Date
    03-12-2013
    Location
    Krakow
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: daily average from months dated back to 2008

    my example file


    dates.xls

  5. #5
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: daily average from months dated back to 2008

    It appears you have Excel 2003. That means you cannot use some of the newer functions.

    Your data does not quite match. The dates in Arkusz1 are for 2009, but you are calling out 2011 in Arkusz2 and Arkusz3. I'll assume you meant for them to be the same year and not a two year offset.

    You need to change the text strings in Arkusz2 and Arkusz3 to actual dates. That way, you can utilize them in your calculations. I changed it to the first of the month (e.g. 1/1/2009)and changed the formatting to show the month and year.

    Once I did that I used this formula in Arkusz2!B4:
    =SUMIF(Arkusz1!$A$4:$A$154,">="&Arkusz2!$A4,Arkusz1!C$4:C$154)-SUMIF(Arkusz1!$A$4:$A$154,">"&EOMONTH(Arkusz2!$A4,0),Arkusz1!C$4:C$154)

    I could then drag that down and to the right to get the same values you did.

    For the average, I would use in Arkusz3!B4:
    =Arkusz2!B4/NETWORKDAYS(Arkusz3!$A4,EOMONTH(Arkusz3!$A4,0))

    Note: In your Arkusz sheet you are counting Fridays and Saturdays off. Is that your intent? Look at the helpfile for WEEKDAY and you will see that 6 stands for a Friday. Your post above says workdays are Monday through Friday, and my forumla should work with that.

  6. #6
    Registered User
    Join Date
    03-12-2013
    Location
    Krakow
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: daily average from months dated back to 2008

    Coming back to the topic, it doesn't work for me, the first part with SUMIF.
    It brings the 0 value. Could you tell me what do you want this second part to do in the formula? ...-SUMIF(Ark...
    Sorry for that late answer

  7. #7
    Registered User
    Join Date
    03-12-2013
    Location
    Krakow
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: daily average from months dated back to 2008

    I get it right now. I did it like this. And it also works
    =SUMIF(Arkusz1!$A$4:$A$154,">="&Arkusz2!$A4,Arkusz1!C$4:C$154)-SUMIF(Arkusz1!$A$4:$A$154,">="&Arkusz2!$A5,Arkusz1!C$4:C$154)
    Thanks for help Payley

  8. #8
    Registered User
    Join Date
    03-12-2013
    Location
    Krakow
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: daily average from months dated back to 2008

    Again coming back to the topic
    Actually I cannot use NETWORKDAYS because:
    - in some of the rows (I have in my real workbook which I couldnt provide here, coz it is in my job) data is put for example once a month so that the statistics doesnt have sense, or some holidays we do not work so that, NETWORKDAYS shows bigger number to divide which do not represent statistics accurately
    - file has data from about 1-1-2006 to 1-1-2013 so that i cannot put it all manually and change for every month the scope of the average to count.
    That is why I need to use somehow comment COUNTA I think or sth with COUNTBLANK but I do not know how to do that.
    Plz help me

+ 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