+ Reply to Thread
Results 1 to 5 of 5

Average if month and hour match

  1. #1
    Registered User
    Join Date
    03-19-2010
    Location
    Salt Lake City, Utah
    MS-Off Ver
    2016
    Posts
    48

    Average if month and hour match

    I am using historical solar data to try to figure out typical solar radiation levels for any given month at any given hour.

    In column A I have a list of dates with hours in "m/d/yyyy h:mm" format. In column B I have the solar radiation level recorded on that date at that time.

    Now I want to create a range of cells with 24 rows (hours) and 12 columns (months). In each cell I want to have an average of the recorded solar radiation levels for each month and each hour.

    I tried averageifs but I don't fully understand how to use it.

    I know I could use a pivot table to accomplish this, however I want to use a formula so that I can convert it to R1C1 and paste it in using VBA.

    Ive attached what I am working with.
    Attached Files Attached Files
    Last edited by pichon; 04-14-2011 at 02:45 AM.

  2. #2
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    Re: Average if month and hour match

    The attached uses two helper columns to extract the month and hour from your date/time, which makes AVERAGEIFS easier to use. Maybe this works for you?
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    03-19-2010
    Location
    Salt Lake City, Utah
    MS-Off Ver
    2016
    Posts
    48

    Re: Average if month and hour match

    That works beautifully. Thank you very much!

  4. #4
    Registered User
    Join Date
    10-29-2013
    Location
    Stuttgart
    MS-Off Ver
    Excel 2013
    Posts
    2

    Re: Average if month and hour match

    thank you @bentleybobb. However I couldn't manage to match the month while the month is displayed in text format. I had to enter numbers manually. Why is that?

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: Average if month and hour match

    devansh welcome to the forum

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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