+ Reply to Thread
Results 1 to 6 of 6

Median if function

  1. #1
    Registered User
    Join Date
    11-11-2012
    Location
    Danmark
    MS-Off Ver
    Excel 2010
    Posts
    16

    Median if function

    Hi All,

    I need to make an if based median calculation.

    e.g. I have a list of numbers in column B and a critera range located column A. I will need to calculate the median of the numbers in B that meets the criteria in A.

    Any help would be highly appriciated
    Last edited by tis1337; 04-30-2016 at 06:40 AM.

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Median if function

    please send a worksheet with the sample input and its expected results..

  3. #3
    Valued Forum Contributor loginjmor's Avatar
    Join Date
    01-31-2013
    Location
    Cedar Rapids, Iowa
    MS-Off Ver
    Excel 2013
    Posts
    1,073

    Re: Median if function

    Hi -

    You could try the following:

    =MEDIAN(OFFSET(B1,MATCH(D2,A1:A11,0)-1,0,COUNTIF(A1:A11,D2),1))

    Where Criteria is in A1:A11, Values are in B1:B11, Criteria is in D2.

    I have attached a sample worksheet.
    Attached Files Attached Files
    ____________________________________________
    If this has solved your problem, please edit the thread title to add the word [SOLVED] at the beginning. You can do this by
    -Go to the top of the first post
    -Select Thread Tools
    -Select Mark thread as Solved

    If I have been particularly helpful, please "bump" my reputation by pressing the small star in the lower left corner of my post.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Median if function

    Try this...

    Data Range
    A
    B
    C
    D
    E
    1
    Region
    Value
    ------
    Median
    2
    East
    13
    North
    50
    3
    North
    50
    East
    28.5
    4
    West
    1
    South
    33.5
    5
    West
    5
    West
    5
    6
    North
    67
    7
    East
    44
    8
    South
    59
    9
    North
    37
    10
    South
    8
    11
    West
    9


    This array formula** entered in E2 and copied down:

    =MEDIAN(IF(A$2:A$11=D2,B$2:B$11))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    11-11-2012
    Location
    Danmark
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Median if function

    Worked like a charm Tony - Thanks for your great formula!

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Median if function

    You're welcome. Thanks for the feedback!

+ 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. Using Median with a look up function
    By rgold in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-08-2008, 02:37 AM
  3. median if function
    By jlogan987 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-08-2007, 12:24 PM
  4. Median Function Help
    By couger77 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-25-2007, 04:47 PM
  5. median function
    By flyingmeatball in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-17-2006, 12:58 PM
  6. median function
    By flyingmeatball in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-17-2006, 11:40 AM
  7. Median function
    By pamanaf in forum Excel General
    Replies: 1
    Last Post: 08-10-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