+ Reply to Thread
Results 1 to 6 of 6

date and date/time matching ad averaging

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    12-03-2008
    Location
    Key West, FL
    MS-Off Ver
    365 Apps for Enterprise
    Posts
    666

    date and date/time matching ad averaging

    This workbook (attached) has date/hour timestamp in column A, so usually you'll see 24 rows per calendar day. Column B contains the values attached to column A.

    I want to match the calendar days (column C) to the values in column A, and then in column D, we want to average the values in column A.

    The formula is not working correctly.

    Could someone either fix the formula, or show me how to write one which accomplishes the same outcome?

    I've manually averaged the first two days, which display the correct values in Column D.

    I will appreciate your help!

    Note: I have hidden rows 1 to 440 because they will not be associated with this task.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,645

    Re: date and date/time matching ad averaging

    You need the function avarageif
    Attached Files Attached Files
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  3. #3
    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
    30,689

    Re: date and date/time matching ad averaging

    in D441

    =IFERROR(AVERAGE(IF(INT($A$441:$A$1000)=C441,$B$441:$B$1000)),"")

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.


    then copy down

    EDIT: previous post added column B with dates only so AVERAGEIF could be used.

    You were comparing DATE+TIME vs DATE so you will only get occasional matches.
    Last edited by JohnTopley; 01-21-2018 at 03:49 PM.

  4. #4
    Forum Contributor
    Join Date
    12-03-2008
    Location
    Key West, FL
    MS-Off Ver
    365 Apps for Enterprise
    Posts
    666

    Re: date and date/time matching ad averaging

    Thanks so much William and John. I went straight to John's formula, which works. It also occurred to me that if I want some other metric such as trimean or median, I could rearrange the formula so it begins with an If statement. (=if date in C is... , trimean). If I did that would it reduce CPU time since its not an array?

  5. #5
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,174

    Re: date and date/time matching ad averaging

    Or try:

    =IFERROR(AVERAGEIFS($B$441:$B$1000,$A$441:$A$1000,">="&C441,$A$441:$A$1000,"<"&C441+1),"")

    Normal enter.

  6. #6
    Forum Contributor
    Join Date
    12-03-2008
    Location
    Key West, FL
    MS-Off Ver
    365 Apps for Enterprise
    Posts
    666

    Re: date and date/time matching ad averaging

    Thanks everyone 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)

Similar Threads

  1. [SOLVED] Matching date and time
    By hanif in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-03-2016, 10:57 AM
  2. determine time -date intervals in an array and averaging the cells included in the interva
    By xiomaraherrera in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-04-2016, 01:02 PM
  3. Matching date and time between 2 files
    By jeustace77 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-24-2014, 05:29 AM
  4. Add date criteria matching order date and sales date
    By Luther.King in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-25-2014, 10:09 AM
  5. Averaging Data Points Associated to Date/Time Ranges
    By Tokkul in forum Excel General
    Replies: 1
    Last Post: 01-12-2012, 05:27 PM
  6. Matching Value in F:F to lastest date/time in A:A
    By scaffdog845 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-15-2010, 11:33 AM
  7. Averaging Data based on date / time stamp
    By liverpoolphil in forum Excel General
    Replies: 3
    Last Post: 10-15-2009, 09:18 AM

Tags for this Thread

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