“N/A” and dashes in a column that should be numbers

A numeric column contains “N/A”, “-”, “n.a.”, or “(blank)” alongside real figures.

Why it happens

  • These are all a human writing “nothing here” in a cell that has no way to say it.
  • They do not all mean the same thing, which is what makes replacing them with zero dangerous.
  • There are several dash characters and they are not interchangeable to a computer.

What to do now

  1. Decide what absent should mean for this column before touching anything, and write it down.
  2. Never blanket-replace placeholders with zero in a column that is summed or averaged.
  3. Search for each dash character separately, or match a character class covering all of them.

Next time

The common placeholders are recognised as blank rather than as text: an empty cell, a hyphen, an en dash, an em dash, a double hyphen, “n/a”, “n.a.”, “(blank)”, and “(empty)” are all read as nothing there.

Start from the inventory count template.

Related problems

Set your fields once

Every file after that is checked before anything lands.