+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Registered User
    Join Date
    06-15-2008
    Posts
    27

    Exclude abnormality

    Hi

    I have a long set of data (like 1500 rows or more - its for example stock prices). In those data sometimes there is a bad dataprovider, so I get a very wrong price and therefore I cant make a proper graph of it. How can I somehow smooth that or exclude the bad data points (I dont wanna do it with the axis on the graph).

    LPN

  2. #2
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,126
    One way is that you can overwrite the "bad" entries with the formula =NA() this will put the #N/A error in the cell and won't be plotted on the chart.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    18,225
    Is the bad data in one specific column? You could add another column to interpret that column and make corrections, supressing bad data altogether and then chart this helper column.

    Or if the corruption is in a specific format, perhaps a macro to clean the data up prior to charting?
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

  4. #4
    Valued Forum Contributor Shijesh Kumar's Avatar
    Join Date
    05-26-2008
    Location
    Bangalore / India
    MS-Off Ver
    2000
    Posts
    717
    Hi,

    You can use Data Validation to stop BAD data entry and you can get a smooth graph.


    Click on
    Data -- > Validation.

  5. #5
    Registered User
    Join Date
    06-15-2008
    Posts
    27
    ok, I might not have been specific. The column where I have the data will change on an ongoing basis, so I need an automatic function - I cant just put in NA() manually.

  6. #6
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,126
    Then use a "helper" column with an If() statement that says, if the value is ok, then use it otherwise stick an #N/A.

    e.g. =If(A1=condition_for_true,A1,NA())

    enter your actual condition in the italisized part.

    Then plot that helper column
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  7. #7
    Registered User
    Join Date
    06-15-2008
    Posts
    27
    I have tried this but I cant find a solution with an IF statement that works. Is there something called trim average (I mean an average where you might take out the top and bottom 25 %).

  8. #8
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,126
    There is a Large() and Small() function....

    e.g. =Large(A1:A100,25) will tell you the 25th largest number and =Small(A1:A100,25) will tell you the 25th smallest number.

    .. then you can use an IF() statement like =IF(OR(A1<Large($A$1:$A$100,25),A1>Small($A$1:$A$100,25)),A1,NA())

    adjust ranges to suit and copy down
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  9. #9
    Registered User
    Join Date
    06-15-2008
    Posts
    27
    I have attached a data example. It should be very easy to see the bad data - pls. let me see if you can do something to it.
    Attached Files Attached Files

  10. #10
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,126
    Put this formula in D4 and copy it down the list...

    Code:
    =IF(OR(C4>=LARGE(C:C,25),C4<=SMALL(C:C,25)),NA(),C4)
    You will see some #N/A's ....but maybe you need to increase that 25% marker because a lot of big ones still fall within...
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  11. #11
    Registered User
    Join Date
    06-15-2008
    Posts
    27
    Hmm it was a good try, but I cant get it to work properly. If you find any other ideas, pls. let me know.

  12. #12
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,126
    Can you show us how it did not work?
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  13. #13
    Registered User
    Join Date
    06-15-2008
    Posts
    27
    Look at attachment.
    Attached Files Attached Files

  14. #14
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,126
    Well, the #N/A's didn't get plotted as far as I can see...

    And to get rid of the out-of-wack numbers, you may have to increase the 25 to 50 or higher..

    e.g. =IF(OR(D3>=LARGE(D:D,50),D3<=SMALL(D:D,50)),NA(),D3)

    or just pick a number out of the hat (like 500 as your max) and use a formula like:

    =IF(D3>=500,NA(),D3) so that all the ones over 500 don't get plotted...

    If these don't work... then it's a job for Andy Pope (our resident Chart Guru)
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  15. #15
    Registered User
    Join Date
    06-15-2008
    Posts
    27
    The problem is that the numbers change, so I cant make a fix that above 500, cause in other circumstances that should be above 1000 maybe, and in others again its 200.

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.2.0