+ Reply to Thread
Results 1 to 3 of 3

Hour Averages

  1. #1
    Registered User
    Join Date
    09-22-2020
    Location
    MN, USA
    MS-Off Ver
    Office
    Posts
    1

    Hour Averages

    hello,
    I have months of data on many different devices, I need to calculate hour averages. The log interval is not constant through all devices and data sets. Is there a way to have my average function read the time to create these hour averages?

    The sample sheet I posted is an example of a "perfect" set of data.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Hour Averages

    Try this formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Is that what you are looking for?

    You probably don't want to post a "perfect set of data." It helps more if the data shows worse case scenarios.
    Last edited by ChemistB; 09-22-2020 at 02:02 PM.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,850

    Re: Hour Averages

    A pivot table or the AVERAGEIFS() function should have no difficulty with this -- if you can get your date/time stamps imported into Excel in a way that Excel will recognize them as date/time (and convert them to appropriate serial numbers). If they get imported as text strings, then it will be more difficult.

    You don't say what version of Excel you are using. I know my version (2007) will not like those date/time stamps -- mostly the "T" and "Z" characters. I think getting time stamps that Excel can recognize is very important to making this easy, so I would:
    A) Visit the logging machine and see if there is any way to change the text format of the time stamp into something Excel can work with. Mostly this is using a space instead of T between the date and time and no putting a Z at the end of the time stamp.
    B) If I cannot change the way the logging machine writes the time stamp, run the text file through a text editor that can do a bulk "replace T with space and replace Z with nothing" process.
    C) I prefer to do the find/replace before importing the text file, but, if that is just not possible, import the file into Excel (making sure the date/time column imports as text) and do the find replace in Excel and make sure Excel recognizes the final date/time stamp as a real date/time serial number (test with ISTEXT() and/or ISNUMBER())

    Once you have got the date/time stamp and the other data imported into Excel, then you can either:
    D) Insert a pivot table using the time stamp as the row label and average of PM2.5 as the value field. Right click on the row labels and group by day and hour.
    E) Or use AVERAGEIFS(). Enter your date/time boundaries in appropriate cells (remember to make sure they are date/time serial numbers and not text). Then =AVERAGEIFS($B$3:$B$3000,$A$3:$A$3000,">"&lower date/time boundary,A$3:$A$3000,"<"&upper date/time boundary)

    These averages should not be too difficult, if you will take the time to help Excel correctly import the time stamp field.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ 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] Calculating Each Hour Worked by Multiple Employees to get the total Cost of Each Hour
    By cs25001 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-06-2019, 06:55 AM
  2. Replies: 1
    Last Post: 09-11-2019, 03:07 AM
  3. Calculating 1 hour averages with missing data
    By Exceloof in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-13-2019, 07:44 AM
  4. Trying to calculate daily averages and seasonal averages
    By sorchah in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 01-03-2018, 11:03 AM
  5. Replies: 4
    Last Post: 03-13-2015, 05:34 AM
  6. Replies: 9
    Last Post: 05-15-2014, 01:57 PM
  7. Replies: 1
    Last Post: 05-02-2008, 10:41 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