+ Reply to Thread
Results 1 to 11 of 11

median and interquartile range of cells containing same value in two other columns

  1. #1
    Registered User
    Join Date
    01-05-2018
    Location
    New Zealand
    MS-Off Ver
    MsExcel 2016
    Posts
    12

    median and interquartile range of cells containing same value in two other columns

    Hi all,

    I want to calculate the median and interquartile range of cells containing same value in two other columns.

    Kindly find attached the data file

    Any help will be appreciated.

    Thanks.

    cdad
    Attached Files Attached Files

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: median and interquartile range of cells containing same value in two other columns

    I don't know enough about statistics to do the 'Interquartile range' or 'Skew'.

    MEDIAN I understand. See if this gets you started.

    Array enter this in G3, fill down and across. If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Edit I'll attempt the 'Interquartile range'. I am not sure I have the concept though. Array enter this in M3, fill down and across.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by FlameRetired; 01-05-2018 at 03:13 PM.
    Dave

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: median and interquartile range of cells containing same value in two other columns

    Quote Originally Posted by FlameRetired View Post
    =IFERROR(MMULT(QUARTILE(IF(($L3=$A$2:$A$31)*(M$2=$B$2:$B$31),$C$2:$C$31),{0,4}),{-1;1}),"")
    Hello Dave

    My understanding is that the interquartile range is the difference between 3rd and 1st quartile, in which case the above works with {1,3} in place of {0,4}

    You could also get the same result using an AGGREGATE function which doesn't require "array entry", i.e.

    =IFERROR(SUM(AGGREGATE(17,6,$C$2:$C$31/($L3=$A$2:$A$31)/(M$2=$B$2:$B$31),{1,3})*{-1,1}),"")
    Audere est facere

  4. #4
    Registered User
    Join Date
    01-05-2018
    Location
    New Zealand
    MS-Off Ver
    MsExcel 2016
    Posts
    12

    Re: median and interquartile range of cells containing same value in two other columns

    Thanks Dave, the interquartile formula works once I adjusted the 0,4 to 1,3 considering representing first and third quartile, you are a star!

  5. #5
    Registered User
    Join Date
    01-05-2018
    Location
    New Zealand
    MS-Off Ver
    MsExcel 2016
    Posts
    12

    Re: median and interquartile range of cells containing same value in two other columns

    Thanks to you too, daddylonlegs, you guys are awesome.

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: median and interquartile range of cells containing same value in two other columns

    DDLL
    Thank you for clarifying the concept.

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: median and interquartile range of cells containing same value in two other columns

    cdad you are welcome. Thank you for the feedback and for marking your thread Solved.

  8. #8
    Registered User
    Join Date
    01-05-2018
    Location
    New Zealand
    MS-Off Ver
    MsExcel 2016
    Posts
    12

    Re: median and interquartile range of cells containing same value in two other columns

    Hi, I tried to adapt the Dave median formula to calculate minimum values but it returned 0 for houses where samples were not collected. I did expect it to ignore the houses where samples were not collected when calculating minimum values. I deliberately do not want to use pivot tables.

    I have re-attached the excel file here

    Any help is appreciated.

    Cheers.

    cdad
    Attached Files Attached Files

  9. #9
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: median and interquartile range of cells containing same value in two other columns

    You can add another condition to exclude blanks, i.e. this formula in G3

    =IFERROR(IF(ISNUMBER(G$2),MIN(IF(($F3=$A$2:$A$31)*(G$2=$B$2:$B$31)*($C$2:$C$31<>""),$C$2:$C$31)),MIN(IF(($F3=$A$2:$A$31)*($C$2:$C$31<>""),$C$2:$C$31))),"")

    confirmed with CTRL+SHIFT+ENTER and copied across and down

  10. #10
    Registered User
    Join Date
    01-05-2018
    Location
    New Zealand
    MS-Off Ver
    MsExcel 2016
    Posts
    12

    Re: median and interquartile range of cells containing same value in two other columns

    Daddy longlegs,

    This feedback has been a great learning experience for me. I really appreciate your support. It works. I successfully modified it to calculate maximums by replacing the min with max.

    However, I adjusted the formula to calculate the COUNTS using the formula below but it is not working.

    =IFERROR(IF(ISNUMBER($X$2),COUNT(IF(($V5=$O:$O)*($X$2=$Q:$Q),$R:$R)),COUNT(IF($V5=$O:$O,$R:$R))),"")
    =IFERROR(IF(ISNUMBER($X$2),COUNT(IF(($V5=$O:$O)*($X$2=$Q:$Q)*($R:$R<>""),$R:$R)),COUNT(IF(($V5=$O:$O)*($R:$R<>""),$R:$R))),"")

    Can you, once again kindly assist please.

    Thanks again.

    cdad

  11. #11
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: median and interquartile range of cells containing same value in two other columns

    cdad since the uploads don't include those ranges we really can't advise you on much beyond encouraging you not to reference whole columns. There are exceptions. This is not one of them. That formula is multiplying values over more than 1 million rows ... repeatedly. That makes Excel work too hard and will slow performance.

    Try another upload, Show us to what ranges and values these formulas refer.

+ 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] Interquartile range function giving wrong results
    By gko_87 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-04-2017, 12:21 PM
  2. Weighted interquartile range
    By asenso in forum Excel General
    Replies: 5
    Last Post: 05-14-2017, 01:18 AM
  3. 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
  4. [SOLVED] Finding median of range of cells containing text and numbers
    By _hs_ in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 04-18-2013, 12:23 PM
  5. [SOLVED] defining a range subset based on a primary range for use in Median and Mode functions
    By Araise in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-06-2013, 06:39 PM
  6. How to find range, coefficient of variation, interquartile range?
    By stathead in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 12-16-2007, 07:29 PM
  7. Scatter plot with median and interquartile lines
    By ninja-lewis in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 05-01-2006, 01:26 PM

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