+ Reply to Thread
Results 1 to 5 of 5

Macro needed to average values on a per day basis, help please!!!

  1. #1
    Registered User
    Join Date
    01-20-2011
    Location
    Boston
    MS-Off Ver
    Excel 2007
    Posts
    41

    Macro needed to average values on a per day basis, help please!!!

    Attached is a sample excel sheet, the real one I'm working on is around 11800 rows long.

    Hello,

    I need a macro that will average the pH in column C by day. So in column A I have a " Date Time" format incrementing every 15 min ie. 11/23/11 10:00, 11/23/11 10:15. I want it to average it per day. So average the pH that are only during 11/23/11, then average the pH that are only during 11/24/11, then 11/25/11, and so on.

    Any help would be appreciated! Thanks!!!Excel Help.xlsx

  2. #2
    Forum Contributor wallyeye's Avatar
    Join Date
    05-06-2011
    Location
    Arizona
    MS-Off Ver
    Office 2010, 2007
    Posts
    308

    Re: Macro needed to average values on a per day basis, help please!!!

    Can you use SumProduct:

    =SUMPRODUCT(N(INT($A$2:$A$1000)=G2),$C$2:$C$1000)/SUMPRODUCT(N(INT($A$2:$A$1000)=G2))

    given a date in G2?

  3. #3
    Registered User
    Join Date
    01-20-2011
    Location
    Boston
    MS-Off Ver
    Excel 2007
    Posts
    41

    Re: Macro needed to average values on a per day basis, help please!!!

    I only have the dates available as a " Date time" format which in your case the code doesn't work, only with a date. It works but I would need to type out every date by itself.

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Macro needed to average values on a per day basis, help please!!!

    How about this in D3 and copied down ( it will give the day's average at the start of each day):

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

  5. #5
    Forum Contributor wallyeye's Avatar
    Join Date
    05-06-2011
    Location
    Arizona
    MS-Off Ver
    Office 2010, 2007
    Posts
    308

    Re: Macro needed to average values on a per day basis, help please!!!

    The int function will return the day of the timestamp, regardless of the time.

+ 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