Filtering observations in Excel
This tutorial shows how to filter observations in order to keep individuals with desired properties in Excel using the XLSTAT software.
Dataset for filtering observations
The dataset contains information on 20 customers: their age, city of residence and gender. We will filter this dataset with respect to the city variable. We want to keep customer coming from the East Coast of the USA.
After opening XLSTAT, select the XLSTAT / Preparing data / Data Management command, or click on the corresponding button of the Preparing data menu (see below).
Once you've clicked on the relevant button, the dialog box appears. Select the method, we use the filter(keep) method since we want to keep customers coming from the East Coast of the USA.
Select the data you want the filter to be applied to in the data field and select the filter column where the name of the cities belonging to the East Coast of the USA is listed (New York and Boston) in the list of values field. When creating your own filter column, make sure that the entered characters are exactly the same as in the dataset.
Once you have clicked on the OK button, a new dialog box appears. When more than one variable has been selected in the dataset, it enables you to select the variable that is used for filtering. In our case, we select the city variable.
Once you have clicked on the OK button, the results are displayed on a new sheet.
Results of the filtering process
The only result that is displayed is the filtered dataset.
We can see that only customers coming from the East Coast of the USA are displayed. You are now able to apply any statistical or data analysis method to these data using XLSTAT.
Note: please note that this filter is not a classicial Excel AutoFilter, the obtained dataset only contain the filtered data.
Was this article useful?