All posts

How to Add a Row Number Column to a CSV (Or Number Contacts Within Each Company)

··3 min read

To add a row number column to a CSV, add a new column that counts 1, 2, 3 down the rows. The add row number to CSV tool does it for a whole file in your browser. Upload a CSV or .xlsx file, name the column, pick where it goes, the start, the step and any zero padding, and download. To rank contacts inside each company, choose the company column under restart the count.

The file is read on your device and not uploaded.

When a row number helps

A row number gives every lead a stable ID. You can quote it when you split a list across people, match rows after sorting, or ask a vendor about row 4,812. It also lets you put a file back in its original order after a sort. Padding with zeros, such as 0001, keeps numbers in the right order when a tool sorts them as text.

Doing it by hand

In Excel or Google Sheets, with one header row:

  • Fill series. Type 1 and 2 in the first two cells of the new column, select both and drag the fill handle down.
  • Formula. =ROW()-1 in the first data row, filled down. In Google Sheets, =ARRAYFORMULA(ROW(A2:A)-1) fills the whole column from one cell.
  • Padded. =TEXT(ROW()-1,"0000"). Copy the column and paste as values, because a CSV opened in a spreadsheet can drop the zeros again.
  • Within each company. With the company in column A, =COUNTIF($A$2:A2,A2) in row 2, filled down, gives 1 for the first Acme row, 2 for the second, and 1 again for the first Globex row.

Formulas shift when you sort, so paste the numbers as values before you sort.

Step 1: load the file

Upload the CSV or .xlsx, or paste the cells with the header row first.

Step 2: choose the numbering

Name the new column and choose first or last, the start (0 or any whole number), the step and the digits. To rank contacts per company, pick the Company or Domain column under restart the count. The count restarts at your start value each time a new value appears, and values are matched without regard to capitals or spaces at the ends.

Rows do not need to be sorted by that column. The count follows the order of the rows in the file.

Step 3: check the preview and download

If the header already has that name, the new column gets a (2) after it. Nothing is overwritten.

Using the group count

A common use is sending the first contact at each company now and the rest later: rows numbered 1 are your first wave. To drop everyone past a set number per company instead, use limit contacts per company, and for a count of contacts per company, see counting contacts per company in a lead list.

What this tool cannot do

  • The numbers are plain text in the CSV, and a spreadsheet may drop leading zeros when it opens the file.
  • Group values are matched exactly apart from capitals and end spaces, so Acme and Acme Inc count separately.
  • It does not sort the rows. Use sort CSV by column.
  • Only the first sheet of a workbook is read.

Check the list before you split it

Numbered rows are ready to share; the addresses still need checking. Upload the list on the verify page: the first 100 email checks are free with a Google sign-in, no card. Each address comes back valid, risky or invalid with a reason, and nothing is sent to anyone on the list. For larger lists, see bulk email verification and pricing.

Number your file now

Open the add row number to CSV tool.

Common questions

How do I add a row number column to a CSV?

In Excel, type 1 and 2 in the first two cells of a new column and drag the fill handle, or use =ROW()-1 on a list with one header row. A row number tool adds the column to the whole file in one step.

How do I get 001, 002, 003?

Set the digits to 3 in the tool. In a spreadsheet use =TEXT(ROW()-1,"000") and save as text.

Can I number contacts within each company?

Yes. In a sheet use =COUNTIF($A$2:A2,A2) with the company in column A. The tool does it by choosing the company column under restart the count.

Does it sort my file?

No. Rows stay in their original order and the numbers follow that order.

What if my header already has that name?

The tool never overwrites a column. If Row is taken, the new column is called Row (2).

Check your list before you send

Real mailbox checks over SMTP, and nothing is sent to the address. Sign in with Google and your first 100 email checks are free, no card. Plans for bigger lists are on the pricing page.