+ Reply to Thread
Results 1 to 7 of 7

MEDIAN IF or IFS

  1. #1
    Registered User
    Join Date
    11-26-2019
    Location
    Northern California
    MS-Off Ver
    2019
    Posts
    2

    MEDIAN IF or IFS

    Hello All,

    Having some trouble here. I did find some Median If topics, but unfortunately I was unable to get it to work for my situation. I've tried Median with nested if statements and IFS. No luck. I'm trying to return the median value of a column of numbers if the date from another column falls within a range (quarterly). Essentially, I've got a year worth of data and I want to return the median value for each quarter. Hopefully that makes sense. Sorry, excel noob here

    In the attached example I want to return the median of column A if Column B falls between two dates (beginning of the quarter and end of the quarter). Ideally, I'd like it to work so that I don't need to specify the number of rows each time as well (dynamic?)

    Thank you in advance!

    Scott
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: MEDIAN IF or IFS

    Array-enter (press ctrl+shift+Enter instead of just Enter) the following formula:

    =MEDIAN(IF($B$2:$B$1000>=E2, IF($B$2:$B$1000<=F2, $A$2:$A$1000)))

    You should see curly-brackets ("{...}") in the Formula Bar.

    That assumes that E2 contains your start date and F2 contains your end date.

    Change the references to row 1000 to the most amount of data that you might reasonably expect to ever have. It is imprudent to use whole-column references like $B:$B, because Excel will look at all 1+ million rows and create temporary arrays of 1+ million entries.

  3. #3
    Registered User
    Join Date
    11-26-2019
    Location
    Northern California
    MS-Off Ver
    2019
    Posts
    2

    Re: MEDIAN IF or IFS

    Thanks Joe!

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,503

    Re: MEDIAN IF or IFS

    Deleted. Wrong answer.
    Last edited by Sam Capricci; 11-27-2019 at 03:58 PM.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,813

    Re: MEDIAN IF or IFS

    MEDIAN is not the same as AVERAGE, though - perhaps you are thinking of MEAN.

    Pete

  6. #6
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,503

    Re: MEDIAN IF or IFS

    sheesh, what was I thinking? I use these all the time and know that, Dope! thx Pete for the reminder.

    that's what I get for multi-tasking.
    Last edited by Sam Capricci; 11-27-2019 at 02:38 PM.

  7. #7
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,790

    Re: MEDIAN IF or IFS

    A
    B
    C
    D
    E
    F
    G
    H
    1
    Widgets Date
    2
    5
    1/1/2019
    1/1/2019
    7/1/2019
    median
    3
    10
    2/1/2019
    15
    4
    15
    3/1/2019
    5
    20
    4/1/2019
    6
    30
    5/1/2019
    7
    50
    6/1/2019
    8
    1
    7/1/2019
    9
    8
    8/1/2019
    10
    15
    9/1/2019
    11
    120
    10/1/2019
    12
    90
    11/1/2019
    13
    45
    12/1/2019


    Only Enter

    H3=AGGREGATE(16,6,(A2:A1000)/(B2:B11000>=F2)/(B2:B1000<=G2),0.5)

+ 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. Replies: 2
    Last Post: 04-26-2017, 11:28 AM
  2. Replies: 8
    Last Post: 08-09-2016, 12:50 AM
  3. [SOLVED] Using Median IF to calculate the median for a specific criteria
    By boynejs in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-20-2014, 01:50 AM
  4. Using Median to get the median of seconds per day per checkpoint
    By dodgerpixie in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-16-2014, 03:38 AM
  5. 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
  6. [SOLVED] Do a median without using the mean
    By Gaz_m2k5 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-21-2013, 12:37 PM
  7. [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

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