HomeGuidesHow to Filter Rows in a CSV File by Column Value
Guide

How to Filter Rows in a CSV File by Column Value

3 methods — browser tool, Excel, and Python

Filtering a CSV means keeping only the rows that match a condition — for example, all customers in a specific state, orders above a certain amount, or records with a particular status. Here's how to do it three different ways.

Method 1: Using Tabular (browser, no software)

  1. 1Go to the Filter Rows tool on Tabular.
  2. 2Upload your CSV or XLSX file.
  3. 3Select the column to filter on.
  4. 4Choose a condition: equals, contains, starts with, is empty, greater than, etc.
  5. 5Enter the value to match.
  6. 6Click Run — only matching rows are kept. Download the result.

Tabular keeps rows that match your condition. To exclude rows (keep non-matching rows), use the 'does not equal' or 'does not contain' conditions.

Method 2: Using Excel AutoFilter

  1. 1Open your CSV in Excel.
  2. 2Click any cell in your data, then go to Data > Filter to enable AutoFilter.
  3. 3Click the dropdown arrow on the column header you want to filter.
  4. 4Select specific values, or use 'Text Filters' / 'Number Filters' for conditions.
  5. 5To export the filtered result: select the visible rows, copy, paste into a new sheet, then save as CSV.

Excel AutoFilter hides rows — it doesn't delete them. To get a true filtered CSV, you must copy the visible rows to a new sheet before saving.

Method 3: Using Python (pandas)

  1. 1Install pandas: pip install pandas
  2. 2Run the script below, adjusting the column name and condition.

python

import pandas as pd

df = pd.read_csv("input.csv")

# Keep rows where a column equals a value
df_filtered = df[df["status"] == "active"]

# Keep rows where a column contains a substring
# df_filtered = df[df["email"].str.contains("@gmail.com", na=False)]

# Keep rows where a number column exceeds a threshold
# df_filtered = df[df["amount"] > 100]

# Combine conditions
# df_filtered = df[(df["status"] == "active") & (df["amount"] > 100)]

df_filtered.to_csv("output.csv", index=False)

When combining conditions in pandas, use & for AND and | for OR, and wrap each condition in parentheses. Python's 'and'/'or' keywords don't work with pandas Series.

Frequently asked questions

Can I filter on multiple columns at once?

In Tabular, each filter operation targets one column. For multi-column filtering, run the tool twice — filter on the first column, download, then upload the result and filter on the second column. In pandas, combine conditions with & (AND) or | (OR).

How do I filter rows that contain a partial match?

Use the 'contains' condition in Tabular. In Excel, use Text Filters > Contains. In pandas, use df[df['column'].str.contains('partial', na=False)].

How do I filter out rows instead of keeping them?

Use the inverse condition: 'does not equal', 'does not contain', or 'is not empty' in Tabular. In pandas, use the tilde operator: df[~df['column'].str.contains('value')].

How do I filter rows where a cell is blank?

In Tabular, select 'is empty' as the condition. In pandas, use df[df['column'].isna()] to keep only blank rows, or df[df['column'].notna()] to remove blank rows.

Ready to try the fastest method?

Keep only the rows that match your criteria — filter by column value, text match, or emptiness. No formulas needed.

Filter Rows — free