How to Pull Matching Rows into a Teacher Roster in Excel
Question details
The user needs to automatically extract and copy specific rows of student data from a master spreadsheet into separate, dedicated worksheets for individual teachers.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Managing a school database where a master sheet contains all student scores, and separate sheets must automatically display only the rows corresponding to a specific teacher.
- Observed behavior
- A dynamic formula is required to pull the data and include headers so the individual rosters automatically update when the master list changes without manual copying and pasting.
Ensure your master spreadsheet has unique, consistent identifiers for each teacher in a specific column, and verify that your spreadsheet application supports dynamic array functions like FILTER and VSTACK.
Use VSTACK and FILTER Functions to Extract Rows
This solution uses dynamic arrays to simultaneously pull the header row and filter the master data for a specific teacher, ensuring the roster is always up to date.
The FILTER function searches a data range and extracts rows that meet a specific condition, while the VSTACK function stacks arrays vertically, allowing you to combine your header row with your filtered results seamlessly.
Take note of your master data range (e.g., 'Master List'!A2:Z500), the header row (e.g., 'Master List'!A1:Z1), and the specific column containing the teacher identifiers (e.g., Column T).
Open or create a new worksheet designated for the specific teacher whose roster you want to populate.
Select cell A1 in the new worksheet and type the following formula: =VSTACK('Master List'!A1:Z1, FILTER('Master List'!A2:Z500, 'Master List'!T2:T500="A", "")).
Replace the letter "A" in the formula with the exact name or identifier of the teacher you are pulling data for, making sure to keep the quotation marks.

Easily Filter and Organize Rosters in WPS Spreadsheet
WPS Spreadsheet fully supports advanced dynamic array functions like FILTER, allowing you to seamlessly organize large educational datasets into individual rosters with perfect Excel compatibility.
- 1. Open your master workbook: Launch WPS Spreadsheet and open the master .xlsx file containing all your student data.
- 2. Create a target worksheet: Click the '+' icon at the bottom to add a new worksheet for the specific teacher.
- 3. Apply the array formula: In cell A1, enter your VSTACK and FILTER formulas to automatically pull the header and matching rows.
- 4. Save your document: Save your file as an .xlsx document to maintain absolute format and formula compatibility.

Frequently Asked Questions
What if my version of Excel doesn't support the VSTACK function?
If your software version lacks VSTACK, you can manually copy the header row (A1:Z1) and paste it into row 1 of the teacher's sheet. Then, in cell A2, simply enter the FILTER formula on its own: =FILTER('Master List'!A2:Z500, 'Master List'!T2:T500="A", "").
How do I filter rows using multiple criteria, like teacher name and grade level?
You can add multiple conditions in the FILTER function by enclosing each logical test in parentheses and multiplying them together. For example: =FILTER(A2:Z500, (T2:T500="A")*(U2:U500="Grade 10"), "").
What is the purpose of the empty quotation marks at the end of the FILTER formula?
The empty string "" serves as the [if_empty] argument. It tells the function to return a blank cell instead of displaying a #CALC! error if no rows in the master list match the specified teacher.
Can I use a cell reference instead of typing the teacher's name directly into the formula?
Yes. Instead of hardcoding "A", you can reference a specific cell (like Z1) where you type the teacher's name. The formula would be updated to: =FILTER('Master List'!A2:Z500, 'Master List'!T2:T500=Z1, ""). This allows you to instantly change the roster view by updating cell Z1.




