Pulling every record that matches a condition into a separate report area — all of one rep’s orders, every overdue invoice — is what FILTER was built for. For Excel 2019 and older, an INDEX/SMALL array does the same job.
The example
An orders table. We extract just Ana’s rows into a report block.
| A | B | C | |
|---|---|---|---|
| 1 | Order | Rep | Amount |
| 2 | 1001 | Ana | $120 |
| 3 | 1002 | Ben | $80 |
| 4 | 1003 | Ana | $200 |
| 5 | 1004 | Cy | $60 |
| 6 | 1005 | Ana | $90 |
The formula
One formula pulls all of Ana’s orders:
How it works
FILTER returns whole rows that pass the test:
- The first argument,
A2:C6, is the full set of columns to return for each match. - The second,
B2:B6="Ana", marks which rows qualify (TRUE/FALSE per row). - Matching rows spill into the report area below the formula — order number, rep, and amount together.
- The third argument,
"None", shows instead of a#CALC!error when nobody matches.
Return only some columns. Wrap FILTER in CHOOSECOLS to pull, say, just order number and amount: =CHOOSECOLS(FILTER(A2:C6, B2:B6="Ana"), 1, 3).
Try it: interactive demo
Pick a rep; their rows are extracted into the report block.
Variations
Legacy: INDEX / SMALL / IF (Excel 2019)
The classic array formula, entered with Ctrl+Shift+Enter and filled down, returns the nth match:
Two conditions
Multiply for AND — Ana’s orders of at least $100:
Sort the extracted rows
Wrap in SORT to order the report — biggest first:
Pitfalls & errors
#SPILL! The report area isn’t clear. FILTER needs empty cells to write the matching rows into.
#CALC! on no matches. Supply the third argument (e.g. "None") so an empty result is handled.
The legacy INDEX/SMALL formula is fragile. It must be array-entered and the ranges locked exactly. If you have Excel 365, FILTER is far simpler and safer.
Practice workbook
Frequently asked questions
How do I extract all rows that match a criterion in Excel?
How do I extract matching rows in Excel 2019?
How do I return only some columns of the matches?
Stop fighting formulas. Learn them in a day.
This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class