+ Reply to Thread
Results 1 to 5 of 5

Searching a range of values for outliers

  1. #1
    Registered User
    Join Date
    05-21-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    39

    Searching a range of values for outliers

    Hi!! I've been trying with no luck to come up with a way to:

    a) find all the outliers in a range of a 1000 rows. The criteria is simply +/- average*2. The outlier can either be above or below.
    b) colour the background of these outliers.
    c) repeat a&b in the next column.

    So in essence, I'm trying to find all values in a table that are twice (positive or negative) that of the average and highlight them.

    Example:
    A, B
    4, 1
    4, 1
    4, 1
    4, 4
    4, 1
    4, 1
    4, 1
    12, 1

    In this case the outlier for A is 12 and the outlier for B is 4.

    Any help, be it in a formula for a given cell, or VBA, is deeply appreciated.

    Sincerely
    Kurifodo

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Searching a range of values for outliers

    Hello and welcome to the forum,

    Just for clarification, you mean the average (mean * 2) without the value we are checking because if you include the outlier as in your example (A8) is not an outlier. Second do you want an answer without vba? Off the top of my head, I see this a vba question, but others may be able to put together a forumla to solve this problem.

    abousetta

  3. #3
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: Searching a range of values for outliers

    Hello,

    The criteria is simply +/- average*2.
    the result of this calculation applied to all values in column A is 10 (given your data sample)

    12 is not twice of that.

    The median of all the numbers multiplied by 2 is 8. 12 is also not twice of that.

    Applying both Average()*2 and Median()*2 would not identify 12 as an outlier. So we need a better way to identify 12 as an outlier. Once that's nailed down, the formula can be used in conditional formatting.

  4. #4
    Registered User
    Join Date
    05-21-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Searching a range of values for outliers

    what i meant is using =average(A1:A8). this results in 5, thus average*2 is 10. since 10<12 it should be classed as an outliers. For B it is the same principal. =average(B1:B8). where the result is 1.375, thus average*2 = 2.75, this makes makes 4 an outlier. A & B are completely separate from each other. thus if the answer needs to be in VBA, then that's fine, if it can be implemented as a formula, that's also great. Hopefully I've explained it a bit better

    Thank you very much for trying to help so far, it's appreciated.

    Kurifodo

  5. #5
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: Searching a range of values for outliers

    Yeah, well, I guess in real life, your outlier values will be spread among the non-outliers, so the data will more likely look like

    A, B
    4, 1
    4, 1
    4, 1
    4, 4
    12, 1
    4, 1
    4, 1
    4, 1

    with the outlier values tucked safely amongst the rest of them. The challenge is to come up with something that identifies them as outliers when you don't know which cells they're in. So, how do you identify the cells that are allowed to contribute to the average or median?

    Are you prepared to sort your data by value?

+ 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