+ Reply to Thread
Results 1 to 9 of 9

Median as an Array does not ignore blanks

  1. #1
    Registered User
    Join Date
    05-06-2010
    Location
    CT
    MS-Off Ver
    Excel 2003
    Posts
    8

    Median as an Array does not ignore blanks

    Hi All,
    Help please! Struggling with this one.

    Using a mean formula it will automatically ignore blanks. That is great...exactly what I need it to do. However, when you use it in an array it no longer ignores blanks and give you a different answer. I need it to ignore blanks so I can use it as a 'meanif' formula.

    Description Median Totals
    Type 1 0.48
    Type 1 2.82
    Type 1
    Type 1 4.56
    Type 1 1.62
    Type 1 0.82
    Type 1 -3.35
    Type 1 -10.82
    Type 1 6.33


    Type 2 50000

    Type 1 Median 1.22

    Median as an Array
    0.82095


    =MEDIAN(IF($A$2:$A$19987=$A2,B$2:B$19987))

    The answers match if I type a number over the blank but I will have valid blanks in many scenarios.

    Thanks!!!

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Median as an Array does not ignore blanks

    Add another nested IF



    =MEDIAN(IF($A$2:$A$19987=$A2,IF(B$2:B$19987<>"",B$2:B$19987)))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor day92's Avatar
    Join Date
    04-20-2010
    Location
    Los Angeles
    MS-Off Ver
    Excel 360
    Posts
    600

    Re: Median as an Array does not ignore blanks

    This should work..

    =IF(ISBLANK(A2),MEDIAN(IF($A$2:$A$19987=$A2,B$2:B$19987)))

  4. #4
    Registered User
    Join Date
    05-06-2010
    Location
    CT
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Median as an Array does not ignore blanks

    Quote Originally Posted by day92 View Post
    This should work..

    =IF(ISBLANK(A2),MEDIAN(IF($A$2:$A$19987=$A2,B$2:B$19987)))


    This looked good but it just gives me an answer of FALSE

  5. #5
    Registered User
    Join Date
    05-06-2010
    Location
    CT
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Median as an Array does not ignore blanks

    Quote Originally Posted by NBVC View Post
    Add another nested IF



    =MEDIAN(IF($A$2:$A$19987=$A2,IF(B$2:B$19987<>"",B$2:B$19987)))

    This doesn't seem to work either. I am just getting a answer of 0.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Median as an Array does not ignore blanks

    Quote Originally Posted by ctbrian View Post
    This doesn't seem to work either. I am just getting a answer of 0.
    Are you sure.. I got 1.22 in my test.

    Did you confirm with CTRL+SHIFT+ENTER?

  7. #7
    Registered User
    Join Date
    05-06-2010
    Location
    CT
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Median as an Array does not ignore blanks

    Quote Originally Posted by NBVC View Post
    Are you sure.. I got 1.22 in my test.

    Did you confirm with CTRL+SHIFT+ENTER?

    Yes I made sure to use the ctrl+shift+enter. Any chance you can attach your example file so I can look at it closer? It is probably something I am doing but I can't seem to figure out what that is. Your example would help. Thanks!

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Median as an Array does not ignore blanks

    Attached....
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    05-06-2010
    Location
    CT
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Median as an Array does not ignore blanks

    Wow! Thank you! You rock!

    This works perfectly!

    (BTW I pasted my example in a bad location and had a circular reference which is why I was getting zero)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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