+ Reply to Thread
Results 1 to 6 of 6

average from (58 rows)or from 29 first day hourly data of every mounth

  1. #1
    Forum Contributor
    Join Date
    08-06-2014
    Location
    iran
    MS-Off Ver
    2016
    Posts
    110

    average from (58 rows)or from 29 first day hourly data of every mounth

    hi
    i have a file with 24 hourly data for one day (Attached) and i want to get average from every 29 first days of every Mounth in a year (2*29=58 row) and becuase of 28 days of February the 31th of January add to it
    how can i do it with VBA code could some one help me
    thanks so muchaverage.png
    Attached Files Attached Files

  2. #2
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: average from (58 rows)or from 29 first day hourly data of every mounth

    Hi
    Use these formula and copy down

    =IFERROR(AVERAGE(OFFSET($D$1:$O$58,2*29*(ROW(A1)-1),0)),"")

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Regards

  3. #3
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: average from (58 rows)or from 29 first day hourly data of every mounth

    Hi
    This formula looks for the first day of the month and gives the desired average
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The R column contains dates
    See the file Book1 (11).xlsx
    Regards
    Last edited by José Augusto; 11-10-2015 at 07:00 PM.

  4. #4
    Forum Contributor
    Join Date
    08-06-2014
    Location
    iran
    MS-Off Ver
    2016
    Posts
    110

    Re: average from (58 rows)or from 29 first day hourly data of every mounth

    hi mr
    Thank you for taking the time to solve my thread
    yellow column is what i want please correct your formula and if the exception (28 days of
    february) makes difficulty WAIVER it.i get average of this mounth separately .
    with regard
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,366

    Re: average from (58 rows)or from 29 first day hourly data of every mounth

    Use

    =IFERROR(AVERAGE(OFFSET($D$1,MATCH(R1,$C$1:$C$1092,0)-1,0,58,12)),"")

    Waiver for February is difficult so appreciated if you can handle this "offline".

  6. #6
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: average from (58 rows)or from 29 first day hourly data of every mounth

    Hi
    Thank you John Topley for your correction.
    Follows the formula considering the 28 days of February.
    You can also correct to consider the months with 29, 30 and 31 days wearing the same strategy (see column T).

    =IFERROR(AVERAGE(OFFSET($D$1,MATCH(R1,$C$1:$C$1092,0)-1,0,58-(DAY(DATE(MOD(R1,100)+1900,MOD(INT(R1/100),100)+1,1)-1)=28)*2,12)),"")
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    See the file Book1 (11) (1).xlsx

    Fakhteh, I suppose the value that indicates is incorrect. Check, please.
    Regards

+ 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] Reducing one minute data to hourly average??
    By NikRaven in forum Excel General
    Replies: 9
    Last Post: 11-03-2021, 06:32 AM
  2. Converting Half-hourly data into average daily data
    By TommyHayes1989 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-24-2018, 11:19 AM
  3. How to create daily average from hourly data
    By bubble_fisch in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 02-03-2016, 02:21 PM
  4. Average hourly data by day
    By juanjogini in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 11-02-2014, 03:26 PM
  5. [SOLVED] Calculate hourly average data
    By isidorian in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-20-2014, 06:34 AM
  6. Help for calculating monthly average from hourly data
    By udaslelmi in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-13-2013, 12:59 PM
  7. [SOLVED] Average hourly values of the same day (one column with six months of data)
    By Exorbit in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-30-2013, 06:42 AM

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