HomeGuidesHow to Fill Empty Cells in a CSV File
Guide

How to Fill Empty Cells in a CSV File

3 methods — browser tool, Excel, and Python

Empty cells in a CSV cause import errors, break formulas, and create data gaps in dashboards. There are two main approaches: fill with a static value (like 'N/A' or 0) or use forward/backward fill to propagate adjacent values. Here's how.

Method 1: Using Tabular (browser, no software)

  1. 1Go to the Fill Empty Cells tool on Tabular.
  2. 2Upload your CSV or XLSX file.
  3. 3Choose a fill method: static value, forward fill (use the value above), or backward fill (use the value below).
  4. 4Optionally restrict to specific columns.
  5. 5Click Run and download the result.

Forward fill is useful for grouped data where a value in column A applies to multiple rows — common in exports from reporting tools that only show the group header once.

Method 2: Using Excel

  1. 1Open your CSV in Excel.
  2. 2Select the column or range with empty cells.
  3. 3Press Ctrl+G (Go To) > Special > Blanks. This selects all blank cells.
  4. 4Type your fill value, then press Ctrl+Enter to fill all selected cells at once.
  5. 5For forward fill: select the range, go to Home > Fill > Down.
  6. 6Save as CSV via File > Save As.

Ctrl+Enter fills all selected cells simultaneously — much faster than filling each blank individually.

Method 3: Using Python (pandas)

  1. 1Install pandas: pip install pandas
  2. 2Run the script below for your fill type.

python

import pandas as pd

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

# Fill all blanks with a static value
df = df.fillna("N/A")

# Fill blanks in a specific column only
# df["status"] = df["status"].fillna("unknown")

# Forward fill (propagate last valid value downward)
# df = df.ffill()

# Backward fill (propagate next valid value upward)
# df = df.bfill()

# Fill numeric columns with 0, text columns with "N/A"
# df = df.fillna({col: 0 if df[col].dtype in ['int64','float64'] else "N/A" for col in df.columns})

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

Frequently asked questions

What is forward fill and when should I use it?

Forward fill copies the last non-blank value downward to fill gaps below it. Use it when your data has a repeating group structure — for example, a product category that spans multiple rows but is only listed in the first row of each group.

Should I fill empty cells with 'N/A', 0, or leave them blank?

It depends on the destination. Databases and APIs often require non-null values in required fields — use 'N/A' or a default value. Numeric columns used in calculations should be 0 rather than blank to avoid formula errors. For optional fields, leaving them blank is often fine.

How do I fill only certain columns, not the whole file?

In Tabular, use the column selector to restrict the fill to specific columns. In pandas, apply fillna() to a specific column: df['column_name'] = df['column_name'].fillna('value').

How do I find which cells are empty before filling them?

Upload your file to Tabular's CSV Validator — it reports blank cell counts per column. In pandas: df.isna().sum() prints a count of blank cells per column.

Ready to try the fastest method?

Replace blank cells with a static value, or fill them from the cell above (forward fill) or below (backward fill).

Fill Empty Cells — free