Sorting and Filtering Data in Google Sheets
Objective:
Understand how to sort and filter datasets using basic and advanced filter options, including sort by condition.
Step 1: Sample Dataset
Create this sample table in your Google Sheet:
Name | Age | City | Score |
---|---|---|---|
Anjali | 22 | Bhopal | 87 |
Rohit | 21 | Indore | 65 |
Sneha | 24 | Bhopal | 78 |
Aman | 23 | Ujjain | 90 |
Pratik | 20 | Indore | 55 |
Step 2: Basic Sorting
Sort by Score (Descending)
-
Select the full data table including headers
-
Click on Data > Sort range
-
Check Data has header row
-
Sort by Score → Z → A
This will sort students from highest to lowest scores.
Sort by Name (Alphabetical)
-
Use A → Z to sort names alphabetically
Step 3: Apply Basic Filter
Add Filter:
-
Select your table including headers
-
Click Data > Create a filter
-
Small filter icons appear in header cells
Filter Example:
-
Click filter icon on City column → Uncheck all → Select only Bhopal
-
You will now only see rows from Bhopal
Clear filters anytime using Data > Remove filter
Step 4: Sort by Condition
Example: Show students scoring above 70
-
Click filter icon on Score column
-
Choose Filter by condition
-
From dropdown, select Greater than → type
70
-
Click OK
You will now see only students with scores above 70.
Other condition options include:
-
Text contains
-
Date is before/after
-
Empty / Non-empty
Step 5: Advanced Filter – Filter Views
Filter views allow different users to view different filters without affecting others.
Create a Filter View:
-
Click Data > Filter views > Create new filter view
-
Apply a filter (e.g., show only Age > 21)
-
Rename the view (e.g., “Age Filtered View”)
-
Use the view when needed, others won’t be affected
Mini Practice Challenge – Employee Data
Employee | Dept | Salary | Location |
Aayushi | HR | 35000 | Delhi |
Manav | Marketing | 28000 | Bhopal |
Raj | HR | 30000 | Delhi |
Riya | Sales | 40000 | Mumbai |
Tasks:
-
Sort employees by Salary (High to Low)
-
Filter to show only Delhi employees
-
Apply condition to show Salary > 30000
-
Create a filter view for only HR department