+ Reply to Thread
Results 1 to 6 of 6

Loop - average

  1. #1
    Registered User
    Join Date
    10-04-2011
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    3

    Loop - average

    Hy!

    I have a table in Excel like in an attachment.

    I would like to calculate a Number average for every day in a year period - beside Number.

    How can I do that with macro (loop - for)?

    Help please, thanks.
    Attached Images Attached Images

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Loop - average

    I don't follow? What exactly are you trying to average?

  3. #3
    Registered User
    Join Date
    10-04-2011
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Loop - average

    Quote Originally Posted by JapanDave View Post
    I don't follow? What exactly are you trying to average?
    Numbers per day. In day 1 we have number 23 at 1 o'clock, 24 at 2 o'clock and so on to 12 at 24 o'clock. So (23+24+...+12)/24=average

    I don't know how to loop to get average with macro for every day in a year.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Loop - average

    Post a sample sheet... I'm tempted to post up pictures of results.

    Click GO ADVANCED and use the paperclip icon to post up a copy of your workbook.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  5. #5
    Registered User
    Join Date
    10-04-2011
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Loop - average

    Quote Originally Posted by JBeaucaire View Post
    Post a sample sheet... I'm tempted to post up pictures of results.

    Click GO ADVANCED and use the paperclip icon to post up a copy of your workbook.
    I can't find GO ADVANCED, so I've just attached xls.

    What's red is an average of numbers through day. I want that to be calculated with macro for every day in one year (for example: 1.1.2008-1.1.2009).
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Loop - average

    hi, johns22, it can be done this way without looping each cell, run code "test"
    Attached Files Attached Files
    Last edited by watersev; 10-05-2011 at 07:51 AM.

+ 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