+ Reply to Thread
Results 1 to 9 of 9

Average

  1. #1
    Registered User
    Join Date
    02-07-2008
    Posts
    60

    Average

    Hello Excel experts

    I would like to ask you for favor.

    I am getting a report every month with data covering last three months (see example in the attachment). On the "raw" sheet are the data what I got for processing. I would like to have a macro which will count average of data in column "D" for every month separately. Then the result will be loaded to a table like you can see on the "avg" sheet. The macro should be executable by hitting the "count button".

    All replies are appreciated.

    Thank you in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Average

    Have you thought about using a pivot table?

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    02-07-2008
    Posts
    60

    Re: Average

    Quote Originally Posted by Domski View Post
    Have you thought about using a pivot table?

    Dom
    Hi,

    Yes I know pivot table is an option, but for this I would need a solution as I described. The attached report is just a small part of a much bigger entity.

    Thank you for you advise.

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Average

    You wouldn't want to use a pivot to summarise the data then? It would be quite easy to put together a macro to create one automatically.

    Dom

  5. #5
    Registered User
    Join Date
    02-07-2008
    Posts
    60

    Re: Average

    Quote Originally Posted by Domski View Post
    You wouldn't want to use a pivot to summarise the data then? It would be quite easy to put together a macro to create one automatically.

    Dom
    The length of raw data differs every month as each month has different count of day so I am bit confused by defining input data for the pivot table. I don't want to do that manually. Would it be possible to automatize it? Could you please show me an example?

    Thank you

  6. #6
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Average

    How about this?

    Please Login or Register  to view this content.

    Dom

  7. #7
    Registered User
    Join Date
    02-07-2008
    Posts
    60

    Re: Average

    Hi Dom,

    Thank you very much for this code. It works perfectly in a stand-alone solution but it is not implementable into a complex reporting system. I would really appreciate if you can help me to figure out my original request.

    Thank you
    Last edited by shg; 06-17-2011 at 10:40 AM. Reason: deleted quote

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

    Re: Average

    Link, please don't quote whole posts; it just clutters the thread. Use the REPLY button, not the QUOTE button.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

  9. #9
    Registered User
    Join Date
    02-07-2008
    Posts
    60

    Re: Average

    Can anybody help me to figure it out please?

+ 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