Sorting, Filtering, and Data Tables

Learn to organize and analyze data with Excel's sorting and filtering tools, convert data ranges to Excel Tables for powerful automatic features, and prepare spreadsheets for professional printing.

Video

Watch the lesson video, then complete the reading and challenge.

Presentation Slides

Review the slides below, then complete the reading and challenge.

Sorting by One Column vs Multiple Columns — alphabetical, numerical, and date sorting
1 / 9

Lesson Notes

Read through the key concepts before you try the challenge.

Real-World Scenario

Your office manager at Lakeside Medical Associates needs three things from the supply tracker right now: (1) the list sorted alphabetically by Category, then by Item Name within each category; (2) only the items currently showing 'LOW' or 'OUT' status filtered and visible for the reorder meeting; and (3) a printed version of the filtered list to post on the supply room whiteboard. All three tasks require the sorting, filtering, and printing skills in this lesson — and they need to be done in the next 15 minutes before the meeting starts.

Sorting Data

Sorting reorders your data rows based on the values in one or more columns. Excel's sort capabilities go far beyond simple alphabetical sorting — you can sort by multiple columns, sort dates chronologically, and even define a custom sort order for category values:

  • To sort by a single column, click any cell in the column you want to sort by, then click Data > Sort A→Z (ascending) or Data > Sort Z→A (descending). For a text column like Category, A→Z sorts alphabetically. For a number column like Quantity, A→Z sorts smallest to largest. For a date column, A→Z sorts oldest to newest. This is the fastest sort method when you only need one level of sorting.
  • To sort by multiple columns (multi-level sort), use Data > Sort to open the Sort dialog. Click 'Add Level' to add additional sort keys. For the office manager's request — sorted by Category first, then by Item Name within each category — set Level 1 to Column 'Category' (A→Z) and Level 2 to Column 'Item Name' (A→Z). Excel sorts by the first level, then uses the second level as a tiebreaker within groups with the same first-level value.
  • Custom sort orders let you sort by a non-alphabetical sequence you define — for example, sorting supply categories in the order Medical, Cleaning, Office, Break Room rather than alphabetically. In the Sort dialog, click the Order dropdown for a column and choose 'Custom List.' You can use one of Excel's built-in custom lists (months, days of the week) or create your own by typing the values in the order you want them. This is very useful for status columns where you want 'OUT' first, then 'LOW,' then 'OK.'
  • Always confirm your data has a header row and that 'My data has headers' is checked in the Sort dialog — if unchecked, Excel may sort your header row into the middle of the data as if it were a data row. After sorting, scroll up to confirm your header row is still in row 1 and that all data rows have moved correctly.

Filtering with AutoFilter

Filtering hides rows that do not meet your criteria while leaving the underlying data intact — it is not deletion. Filtered rows can be shown again at any time. AutoFilter is Excel's standard filtering tool and is activated for any data range or Excel Table:

  • To activate AutoFilter on a plain data range, click any cell in your data and press Ctrl+Shift+L, or click Data > Filter. Dropdown arrows appear on each column header. To activate a filter, click the dropdown arrow in the column you want to filter — a menu appears showing all unique values in that column with checkboxes. Uncheck the values you do not want to see, or check only the ones you do. For the office manager's request, click the Status column dropdown and check only 'LOW' and 'OUT' — rows with 'OK' status immediately hide.
  • Text filters let you filter for partial matches or complex text conditions — click the column header dropdown, hover over 'Text Filters,' and choose options like 'Contains,' 'Begins With,' 'Ends With,' or 'Does Not Contain.' For example, filtering Item Name for rows that contain 'Gloves' would show all types of gloves (exam gloves, nitrile gloves, latex gloves) while hiding all other items.
  • Number filters let you show rows where values fall within a numeric range — click the dropdown on a number column, hover over 'Number Filters,' and choose 'Between,' 'Greater Than,' 'Less Than,' or 'Top 10.' To show only items where Quantity is less than 10, use Number Filters > Less Than > 10. This is useful for quickly identifying all low-count items without setting up conditional formatting.
  • Date filters provide time-based filtering options — click the dropdown on a date column and hover over 'Date Filters' for options like 'This Week,' 'This Month,' 'Next Quarter,' 'Before,' and 'After.' These are particularly useful in an appointment log for filtering only appointments in the current month or week.
  • To clear all filters and show all data again, click Data > Clear or press Ctrl+Shift+L twice (off then on). To clear the filter on one specific column, click that column's dropdown and choose 'Clear Filter From [Column Name].' Filtered rows are still in the spreadsheet — they are hidden, not deleted. The row numbers turn blue to indicate filtering is active and some rows are hidden.

Excel Tables and Removing Duplicates

Excel Tables are the professional standard for data ranges that are actively managed, updated, and analyzed. Converting your supply tracker to a Table provides automatic features that would otherwise require manual maintenance:

  • Convert any data range to an Excel Table by pressing Ctrl+T with any cell in the range selected. Excel asks to confirm the range and whether your data has headers — click OK. The table immediately gains: alternating row colors for readability, dropdown filter arrows on all column headers, and a special Table Design tab in the Ribbon.
  • The Totals Row is a key Table feature — click any cell in the table and go to Table Design > Table Style Options > check 'Total Row.' A summary row appears at the bottom of the table with dropdown selectors for each column — choose SUM, AVERAGE, COUNT, MIN, MAX, or other functions. The totals row automatically updates as you add, edit, or filter table rows, making it the easiest way to maintain a live running total.
  • Structured references replace cell addresses with column names in table formulas — instead of =SUM(E2:E100), Excel writes =SUM(Table1[Total Cost]). Structured references are self-documenting and automatically expand when new rows are added to the table, so =SUM(Table1[Total Cost]) always sums all rows in the Total Cost column without needing to update the range manually.
  • Remove Duplicates cleans data that may have been entered more than once — click any cell in the table or range, go to Table Design (or Data) > Remove Duplicates, and choose which columns to check for duplicates. If a row has the same value in all selected columns as another row, the duplicate is removed. This is important quality maintenance for supply trackers — if an item was entered twice by different staff members, the tracker will show double the quantity and generate incorrect totals.

Printing Spreadsheets Professionally

Printing an Excel spreadsheet requires more preparation than printing a Word document — by default, Excel prints whatever fits on a standard page, which can produce awkward page breaks in the middle of tables. These settings ensure a printed spreadsheet looks professional and is easy to read:

  • Set a print area to print only the relevant portion of a large spreadsheet — select the cells you want to print, then click Page Layout > Print Area > Set Print Area. The print area is marked with a dashed border. In Print Preview (Ctrl+P), only the print area will appear. Clear the print area using Page Layout > Print Area > Clear Print Area.
  • Fit to page forces the spreadsheet content to fit on a specific number of pages — in the Page Layout tab, the Scale to Fit group lets you set 'Fit Sheet on One Page,' 'Fit All Columns on One Page,' or specific page counts. For the office manager's filtered list, 'Fit All Columns on One Page' ensures the columns are not split across two sheets, which makes the printout readable.
  • Print headers and footers for spreadsheets using Page Layout > Print Titles — under 'Rows to repeat at top,' select row 1 so the column headers print on every page. Add a footer with the date, page number, and file name via Page Layout > Page Setup > Header/Footer tab. A spreadsheet printout with no headers, no page numbers, and no date is unprofessional and hard to file correctly.

Quick Reference: Sorting, Filtering, and Tables

Sorting, Filtering, and Tables Quick Reference — multi-level sort dialog steps, AutoFilter activation and usage guide, Excel Table conversion checklist, Remove Duplicates steps, and print settings for professional spreadsheet output

Sorting, Filtering, and Tables Quick Reference — data analysis and presentation tools

Responsible Use

Sorting permanently reorders your data rows — if you sort a supply tracker and then realize you sorted by the wrong column, the undo (Ctrl+Z) may not work if you have saved and closed the file. Always save a backup copy of any spreadsheet before performing a major sort on a large dataset that you cannot easily reconstruct. When using Remove Duplicates, verify after running it that the data that was removed was truly duplicate — remove duplicates is a permanent operation that cannot be undone after saving. For critical medical office data, maintain a version history by saving dated copies (e.g., 'Supply Tracker – 2025-05-05.xlsx') before major cleanup operations.

AI Assist

💡 AI Task: Ask ChatGPT — 'What is the best way to set up an Excel workbook for a medical office supply tracker that will be maintained by multiple staff members? Include recommendations for table structure, sorting defaults, filter views, print settings, and data validation to prevent entry errors. Also explain how Excel Tables with structured references make the tracker easier to maintain long-term.' Use the response to refine your supply tracker structure before presenting it to your supervisor.

Knowledge Check

You filter your 300-row supply tracker to show only items with 'LOW' status. The row count indicator at the bottom of the screen shows '12 of 300 records found.' What has happened to the other 288 rows?

Challenge

Apply what you've learned in this lesson.

Apply sorting, filtering, and professional printing to your Lakeside Medical Associates supply tracker to produce a reorder report for the office manager. Your report must be printable, filtered to show only items needing action, and clearly formatted.

  1. Sort your supply tracker (20 rows) by two levels: first by Status (custom order: OUT first, then LOW, then OK), then by Category (A→Z) within each status group. Take a screenshot showing the Sort dialog with both levels configured, and another showing the sorted result.
  2. Apply an AutoFilter to show only rows where Status equals 'LOW' or 'OUT.' Take a screenshot of the filtered view showing only the items that need reordering, with the row count visible in the status bar (e.g., '5 of 20 records found').
  3. While the filter is active, set the print area to include only the visible filtered data and the header row. Add a page header with 'Lakeside Medical Associates — Supply Reorder Report' and a footer with the date and 'Page 1 of 1.' Use Fit to Page to ensure all columns fit on one printed page.
  4. Open Print Preview (Ctrl+P) and take a screenshot showing the print preview of the filtered, page-fitted reorder report. Confirm the column headers are visible, all filtered rows are present, and the header and footer appear.
  5. Clear all filters to restore the full 20-row dataset. Remove any duplicate rows if present using Data > Remove Duplicates. Save the final workbook as 'Supply Tracker – Complete – Lakeside Medical.xlsx.'