Taking ranges and filtering out outliers (reducing the size of the range)

RawlinsCross

Active Member
Joined
Sep 9, 2016
Messages
437
I have a userform that displays a graph. The userform has some private member variables through which certain data is passed,

Code:
Option Explicit

'--userform module variables
Private msAxisTitle As String              'accepts axis title
Private msCaptionForGraph As String   'accepts caption for userform
Private msDataIdentifier As String        'accepts the string that identifies what column is to be graphed
Private mrXValues As Range                'X values (dates)
Private mrYValues As Range                'Y values (data - could have extreme values)
Private mwksWorksheet As Worksheet         'accepts the worksheet the data exists on

I'd like to include a button on the userform that takes the mRYValues (data) and calculates the mean and standard deviation and tests for outliers (say over +3 standard deviations) and removes them. The thing is, any data that is moved in mrYValues (data) has to also remove the corresponding mrYValues (dates). Any thoughts on the best way to accomplish this? I'm thinking perhaps a function that accepts two ranges (X and Y), does the work on the Y data, adjusts the X data and returns both ranges again? Not sure......
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,214,528
Messages
6,120,065
Members
448,941
Latest member
AlphaRino

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top