+ Reply to Thread
Results 1 to 7 of 7

Median with two If statements in an array formula

  1. #1
    Registered User
    Join Date
    01-08-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2007
    Posts
    10

    Median with two If statements in an array formula

    Good Morning,

    I'm struggling with an array formula that will use two parameters. In the attached I would like to end up with the median of individual sites by week ending date.

    If I had one parameter (a median of the Days Held based on the Location), I would put in the following.

    ={MEDIAN(IF($A$2:$A$8=A2,$M$2:$M$8))}

    I would also like, as well as the Location, to look at only the max of the Week Ending.

    So, in non-formula terms: where a singular location matches the Location column entries and where the Week Ending date matches the max of the Week Ending date column, return me the median based on Days Held.

    Thank you very much in advance for any help given.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Median with two If statements in an array formula

    Hi,

    Try this array formula in cell N2, then copy down as far as is necessary, adjusting the ranges as necessary also:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Hope this helps

  3. #3
    Registered User
    Join Date
    01-08-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Median with two If statements in an array formula

    Amazing! Thank you VERY much for your help.

  4. #4
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Median with two If statements in an array formula

    You welcome!

    Please don't forget to mark this thread as solved

  5. #5
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: Median with two If statements in an array formula

    =MEDIAN(IF((A2=$A$2:$A$8)*(TEXT($L$2:$L$8,"yy-mm-dd")=(TEXT(L2,"yy-mm-dd"))),$M$2:$M$8))
    Confirm COntrol+shift+Enter
    If you are http://www.excelforum.com/image.php?type=sigpic&userid=125481&dateline=1392355029happy with the results, please add to the contributor's
    reputation by clicking the reputation icon (star icon).




    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.
    To undo, select Thread Tools-> Mark thread as Unsolved.
    http://www.excelaris.co.uk

  6. #6
    Registered User
    Join Date
    01-08-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Median with two If statements in an array formula

    Thanks Robert.

  7. #7
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: Median with two If statements in an array formula

    You are welcome.

+ 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] Median IF OR array formula
    By alex_shin in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-13-2013, 09:26 PM
  2. Array formula - index and match with multiple statements
    By A[L]C in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 06-06-2013, 11:13 AM
  3. Median Array with 3 if statements
    By dstogner in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-09-2012, 10:14 PM
  4. Median as an Array does not ignore blanks
    By ctbrian in forum Excel General
    Replies: 8
    Last Post: 05-06-2010, 03:12 PM
  5. MEDIAN() as array function?
    By Henrik in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-11-2005, 07:05 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