+ Reply to Thread
Results 1 to 4 of 4

Count IF Average, Median , SD and Range

  1. #1
    Registered User
    Join Date
    04-03-2014
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    39

    Count IF Average, Median , SD and Range

    Hello fellow Excel Wizards

    I have a large data set which is probably going to grow to about 50,000 lines

    I'm trying to get a summary of the data together of 2 decimal placed numbers based around a CountIf Formula to work out the above topic mentioned details.

    I've attached an example of the data tab and summary sheet that I'm trying to work out.

    I started using the SUMIFS/COUNTIFS for the averages and messing around with the other functions with CountIfs and arrays but can't get the right combination.

    Help is always appreciated

    Regards
    Matt
    Attached Files Attached Files

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

    Re: Count IF Average, Median , SD and Range

    I think you will need to use Arrayed formulas. Therefore you want to first create dynamic defined names so that Excel is not trying to do an array on an entire column and you don't need to reset it every time you add data. In "Name Manager",

    Dates =Data!$C$2:INDEX(Data!$C:$C, COUNT(Data!$C:$C)+1)
    Data1 =Data!$H$2:INDEX(Data!$H:$H, COUNT(Data!$C:$C)+1)
    Data2 =Data!$I$2:INDEX(Data!$I:$I, COUNT(Data!$C:$C)+1)

    To get Average, you can use a straight up AVERAGEIFS (formulas from row 2)
    =AVERAGEIFS(Data1,Dates,">="&A2,Dates, "<="&EOMONTH(A2,0))

    For the others, you'll need to use Arrays
    ...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. Press F2 on that cell and try again.

    Median Data1
    =MEDIAN(IF(Dates>=A2,IF(Dates<=EOMONTH(A2,0),Data1)))
    Standard Dev Data1
    =STDEV(IF(Dates>=A2,IF(Dates <= EOMONTH(A2,0),Data1)))
    Range Data1
    =MAX(IF(Dates>=A2, IF(Dates<=EOMONTH(A2,0),Data1)))-MIN(IF(Dates>=A2, IF(Dates<=EOMONTH(A2,0),Data1)))
    See attached.
    Does that work for you?
    Attached Files Attached Files
    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
    Registered User
    Join Date
    04-03-2014
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Count IF Average, Median , SD and Range

    That is great! Dynamic Defined Names, makes things a lot easier however I've now run into the last stumpling block which I didn't see eariler.... sorry...

    I need to seperate out 1 specific value that has specific Text name in Column A.

    So the first main summary is 90% of the data then the summary underneath is for values in Column A with TT

    See attached

    Thank you
    Matt
    Attached Files Attached Files

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

    Re: Count IF Average, Median , SD and Range

    Create a dynamic named range for Col A (I used IDName) and
    You will just add another "IF Statement" criteria to each formula, for example, for Median

    =MEDIAN(IF(Dates>=A17,IF(Dates<=EOMONTH(A2,0),IF(IDName="TT",Data1))))

    With your limited data, you get errors for some dates. You could wrap an IFERROR around your formulas to remove those errors.
    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. Median Indirect: Find median in range and bring back adjacent cells
    By Keelin in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 06-27-2014, 08:31 AM
  2. [SOLVED] Average & Median
    By lstevenson in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-27-2014, 02:20 AM
  3. Average, Median Max and Min of a Specific Range
    By PraveshG81 in forum Excel General
    Replies: 2
    Last Post: 05-10-2012, 08:14 PM
  4. Replies: 2
    Last Post: 09-16-2010, 03:33 AM
  5. [SOLVED] pivot: average vs. median
    By dave in Toronto in forum Excel General
    Replies: 2
    Last Post: 09-08-2005, 10:05 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