+ Reply to Thread
Results 1 to 2 of 2

Find average of last 24 hrs data from a filtered range based on a criteria

  1. #1
    Registered User
    Join Date
    02-02-2013
    Location
    Pune
    MS-Off Ver
    Excel 2010
    Posts
    1

    Find average of last 24 hrs data from a filtered range based on a criteria

    Can someone help to to find the average of last 24 hrs data from a filtered range based on a criteria.

    I have date/time stamp in column A, and data X & Y in column in B & C respectively. Column D has the sum of X & Y value. Now i want to filter the data based on "X" (X>250). From this filtered range I want the find the approximate last 24 hours average of column D data ("C") automatically using formula. This value might change if I change the filter range (say >100), dynamic 24 hrs calculation based on visible cells only. I tried subtotal but had to update the reference manually every time after filtering. Is there a formula to do this automatically.

    I have attached the sample file. Please help.
    Attached Files Attached Files

  2. #2
    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,284

    Re: Find average of last 24 hrs data from a filtered range based on a criteria

    See attached:

    I used formulae to find Start and End dates based on selection of "filter" value in C3

    End date in F5:

    =LARGE(IF($B$5:$B$1000>C3,($A$5:$A$1000)*($B$5:$B$1000>C3),""),1)

    Start Date in F6

    =SMALL(IF(($B$5:$B$1000>$C$3)*($A$5:$A$1000>=$F$5-1),($B$5:$B$1000>$C$3)*($A$5:$A$1000>=$F$5-1)*($A$5:$A$1000),""),1)

    both ...
    ...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.

    in F8

    =AVERAGEIFS($C$5:$C$1000,$A$5:$A$1000,">=" &$F$6,$A$5:$A$1000,"<=" & $F$5,$B$5:$B$1000,">" &$C$3)
    Attached Files Attached Files

+ 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] Average only visible (filtered) data that meets criteria.
    By kevsvette in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 10-06-2015, 04:56 PM
  2. Data validation filtered list based on a criteria
    By fredotom in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-24-2015, 11:01 AM
  3. Copy filtered Data into another worksheet based on selected criteria
    By TheresaHartigan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-27-2014, 09:39 AM
  4. VBA Code to Move Data from one range to another based upon filtered criteria
    By Engineer5701 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-06-2013, 03:14 PM
  5. [SOLVED] Need to find an average based on several criteria.
    By Crow47 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-22-2013, 06:14 PM
  6. Replies: 10
    Last Post: 06-28-2012, 08:59 AM
  7. Average a range based on criteria
    By D_N_L in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-14-2012, 07:15 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