How to Filter Specific Data and Numbers with Excel Formulas
Summary of common Excel formula practices for filtering specified data and numbers: use FILTER to extract entire rows by condition, use COUNTIFS and SUMIFS for counting and summing, use ISNUMBER to keep only numeric values, and methods for checking results.
Key Points of This Article
- Use FILTER to extract entire rows that meet conditions; in older versions, you can use the INDEX plus SMALL combination formula instead
- If you only need to count or total items that meet criteria, COUNTIFS and SUMIFS are more direct
- For columns mixed with text, first use ISNUMBER to test, then decide which numbers to keep
- Check formula results for row counts, spill ranges, and blank values to avoid missing or extra data
In Excel, many people run into not a "can't calculate" problem but a "can't pull out" problem: with an order table of several thousand rows, they just want to list the records for the East China region with amounts over 5,000 separately, or keep only the numbers within them. Manual filtering can get the job done once, but every time the data is updated, it has to be redone. Extracting with formulas, on the other hand, means the results update automatically as the source data changes.
This article is for people who regularly organize reports, reconcile accounts, or summarize data. After reading it, you will be able to tell apart three kinds of needs: extracting entire rows, counting and totaling, and keeping only the numbers. You will also know which function to use for each case, how to write the conditions, and how to verify the results. The article focuses on newer versions of Excel, and alternative formulas for older versions are also explained.
How do I select specified data with Excel formulas? One-sentence conclusion
In most cases, use FILTER to extract entire rows based on conditions, and use COUNTIFS or SUMIFS to count or total; if you only want numbers, add ISNUMBER to the FILTER conditions. Before choosing a function, think through whether you want detail records or a summary.
| Your situation | Recommended Practices | Cause |
|---|---|---|
| Please list out the entire rows that meet the conditions. | FILTER function | Returns multiple rows and columns, with results updating as the source data changes |
| Only the count of items that meet the conditions | COUNTIFS | Give the quantity directly, without taking up extra space. |
| Sum only the values that meet the condition | SUMIFS | Can sum by multiple criteria, with a consistent and stable syntax. |
| Keep only the numbers from a column that has mixed text. | FILTER plus ISNUMBER | Exclude the text first, so that irrelevant content doesn't end up mixed into the results. |
| Older versions of Excel do not have FILTER. | INDEX plus SMALL plus IF array formula, or a PivotTable | Compatible with earlier versions, but the formulas are longer or require manual refresh. |
Before You Begin: Confirm These Points First
- Excel version: FILTER requires Excel for Microsoft 365 or Excel 2021 and later. If the version isn't supported, the formula shows #NAME?. Confirming the version first can save a lot of troubleshooting time.
- Data structure: The source data should be a continuous table range, with a header in the first row and consistent data types in each column. Merged cells and blank rows in the middle can cause range references to fail, and the results may be missing rows.
- Numbers or text: Numbers copied from web pages or PDFs are often stored as text. Such cells are usually left-aligned, and a green triangle may appear in the top-left corner. When text numbers are used in "greater than" or "less than" comparisons, the results may not be as expected.
- Is the data source a PDF: If the data is in a PDF table, you can first export it to Excel using the PDF editor in the OmniDoc desktop client (download.omnidoc.top). Scanned PDFs need OCR first, and the recognized results must also be checked against the original text.
Steps to Extract Entire Rows That Meet Criteria Using FILTER
- Organize the data into a single table. Assume the data is in A1 to D200, with the first row as headers: Order No., Region, Amount, Status.
- Select a blank cell to the right of or below the data range as the top-left corner of the result. The area below and to the right of this cell must be left empty; otherwise the result cannot expand.
- Enter the formula: =FILTER(A2:D200, B2:B200="East China", "No matching data found"). Argument 1 is the range to return, argument 2 is the condition, and argument 3 is the message shown when there are no results.
- Modify the condition. Text conditions must be enclosed in English double quotation marks; for numeric conditions, write the comparison operator directly, for example C2:C200>5000.
- When multiple conditions must be met at the same time, connect them with an asterisk () and enclose each condition in its own parentheses, for example (B2:B200="East China")(C2:C200>5000). When both conditions are met, the result is 1, and the row is kept.
- Press Enter, and the result will automatically expand downward and to the right; there is no need to drag cell by cell.
- To extract only one column, change argument 1 to a single-column range, for example A2:A200; to keep only numbers, add an ISNUMBER check to the condition.
Verify each item after completion
| Inspection items | How do you look at it? | What should I do if I have a problem? |
|---|---|---|
| Number of result rows | Use COUNTIFS to count rows that meet the same conditions, then compare the count with the number of result rows. | When there is a mismatch, check whether the condition contains extra spaces or full-width characters. |
| Text matching | Note whether "East China" and "East China " (with a trailing space) are treated as different values. | Use TRIM to remove extra spaces from the source data |
| Number comparison | Check whether the amount column is in number format; numeric values are usually right-aligned. | Convert the textual numbers to digits, then filter. |
| Overflow area | Does a #SPILL! error appear below or to the right of the result? | Clear the content below the result, then re-enter the formula. |
| Empty result | Is the configured prompt displayed when no data matches the conditions? | Relax the criteria, and check whether the text for regions and similar items is spelled consistently. |
| Update test | Add a row matching the criteria at the end of the source data | If the result does not change, check whether the reference range covers the new rows. |
Important reports should have a few more rows sampled and checked item by item against the source data. Content produced by OCR recognition or machine conversion also needs to be verified manually.
📊 Core Comparison
| Method | Output format | Suitable scenarios | Notes |
|---|---|---|---|
| FILTER | Multi-row, multi-column detail | Extract the complete records that meet the conditions | I need a new version of Excel |
| COUNTIFS, SUMIFS | Single value | Count Quantity and Total | Do not return the details. |
| INDEX, SMALL, IF combination | Line-by-line detailed return | Extract details from the old version | The formula is long, so it needs to be entered as an array. |
| PivotTable | Summary Table | View quantity and amount by category | It's not a formula; the source data needs to be refreshed after it changes. |
❓ Frequently Asked Questions (FAQ)
1. FILTER formula shows #NAME? — what should I do?
Usually it's because your Excel version doesn't support FILTER, or the function name is misspelled. First confirm your version; if it's an older version, you can use the INDEX plus SMALL combination instead.
2. How do I extract only numbers greater than a certain value, rather than whole lines?
Use only the numeric column as argument one, for example =FILTER(C2:C200, C2:C200>5000). If this column also contains text, add ISNUMBER, written as =FILTER(C2:C200, ISNUMBER(C2:C200)*(C2:C200>5000)); otherwise text values may also be wrongly judged as meeting the condition.
3. How do I write a condition that requires the text to contain part of a string, such as an address containing "Beijing"?
You can combine SEARCH with ISNUMBER, for example =FILTER(A2:D200, ISNUMBER(SEARCH("Beijing", B2:B200)), "No results"). When SEARCH cannot find the text, it returns an error, and ISNUMBER converts that into TRUE or FALSE.
4. Will the results update automatically when new rows are added to the source data?
Updates only occur when the reference range covers the new rows. You can convert the data range to an Excel table, or extend the range to the expected number of rows, for example A2:D1000.
📝 Summary
Use FILTER to extract entire rows that meet a condition, and COUNTIFS or SUMIFS to count and total. To count only numeric values, add ISNUMBER. After writing the formulas, confirm the results with a row-count comparison and spot-checking samples. This approach reliably solves the problem of how to select specified data with Excel formulas.


