+ Reply to Thread
Results 1 to 3 of 3

Median IF

  1. #1
    Registered User
    Join Date
    10-10-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    2

    Median IF

    Good Afternoon!

    I'm having a problem getting the formula right to calculate the median of a column that contains two pieces of data in corresponding cells.

    I've attached my excel workbook that I'm working in.

    In the "Comparison Data 2" tab I need to calculate the Median in Column E if the Difference (Column A) is located in column M on the Aggregated Raw Data tab.

    The median calculation will be calculated from Column F in the aggregated raw data tab if it contains a value from Comparison Data 2 column A in Aggregated Raw Data column M in the same row.

    Am I making sense?

    The calculation for median should be similar to the calculation for AverageA and AverageB in Comparison Data 2.

    Can anyone help?
    Attached Files Attached Files

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,696

    Re: Median IF

    There is no actual MEDIANIF function so you need to use MEDIAN function with IFs, as an array formula so for E2 this formula

    =IFERROR(IF(Year="ALL",MEDIAN(IF(Difference=A2,yppoTeamA)),MEDIAN(IF(yearColumn=Year,IF(Difference=A2,yppoTeamA)))),0)

    confirmed with CTRL+SHIFT+ENTER and copied down

    That actually works for all rows except the first because when A2=0 the formula interprets blanks in Difference as zeroes and distorts the result....so for row 2 only (or you can include it in the generic formula to make it work for all instances where the criterion is zero) you need this version with an extra condition

    =IFERROR(IF(Year="ALL",MEDIAN(IF(Difference=A2,IF(Difference<>"",yppoTeamA))),MEDIAN(IF(yearColumn=Year,IF(Difference=A2,IF(Difference<>"",yppoTeamA))))),0)

    Repeat with relevant changes for MedianB
    Audere est facere

  3. #3
    Registered User
    Join Date
    10-10-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    2

    Re: Median IF

    Thanks so much! That worked perfectly!

+ 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] Median If
    By zero2658 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-08-2013, 01:32 AM
  3. [SOLVED] Median Ifs, need to find median $ amount per deal for each year
    By xenomorph8472 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-13-2012, 02:01 PM
  4. Median
    By tomribeiropereira in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 03-02-2011, 06:29 PM
  5. Median
    By speedrater in forum Excel General
    Replies: 8
    Last Post: 03-02-2011, 01:40 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