+ Reply to Thread
Results 1 to 4 of 4

Averaging Every Two Cells

  1. #1
    Registered User
    Join Date
    03-21-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    2

    Averaging Every Two Cells

    I have some half-hourly data that I need to average into an hourly number. On the day change there is an annoying gap of two rows. Is there a formula/macro that could help me to ignore the gaps and average the half hour data into it's relevant hourly average number? Thanks in advance!

    Example data:

    02/01/2012 16h30 - 17h00 29.93
    02/01/2012 17h00 - 17h30 39.89
    02/01/2012 17h30 - 18h00 39.89
    02/01/2012 18h00 - 18h30 62.23
    02/01/2012 18h30 - 19h00 62.03
    02/01/2012 19h00 - 19h30 59.79
    02/01/2012 19h30 - 20h00 60.53
    02/01/2012 20h00 - 20h30 57.92
    02/01/2012 20h30 - 21h00 50.69
    02/01/2012 21h00 - 21h30 48.46
    02/01/2012 21h30 - 22h00 37.92
    02/01/2012 22h00 - 22h30 30.92
    02/01/2012 22h30 - 23h00 30.92
    02/01/2012 23h00 - 23h30 57.23
    02/01/2012 23h30 - 24h00 29.49
    Données validées le 04/01/2012.

    03/01/2012 00h00 - 00h30 24.77
    03/01/2012 00h30 - 01h00 43.52
    03/01/2012 01h00 - 01h30 22.35
    03/01/2012 01h30 - 02h00 22.35
    03/01/2012 02h00 - 02h30 14.91
    03/01/2012 02h30 - 03h00 14.91
    03/01/2012 03h00 - 03h30 10.27
    03/01/2012 03h30 - 04h00 10.27
    03/01/2012 04h00 - 04h30 9.99
    03/01/2012 04h30 - 05h00 9.99
    03/01/2012 05h00 - 05h30 16.88
    03/01/2012 05h30 - 06h00 16.88
    03/01/2012 06h00 - 06h30 34.89

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Averaging Every Two Cells

    I believe if you could remove these empty rows, that will do.. right ?

    So better ask a macro (vba) to achieve this .. let me know if this suits you.. thx

    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Averaging Every Two Cells

    I'm not to sure of your sheet layout. Can you work with this formula?
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  4. #4
    Registered User
    Join Date
    03-21-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Averaging Every Two Cells

    Many thanks Marcol, that was very helpful! After using your code, to remove the resultant gaps i sorted the prices by size and then deleted the rows i didn't want, returning the sort to it's previous state after this.

    thanks again for your help

+ 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