BOMParser

The check

Reference designator count check: what it catches, what it cannot

A quantity on a BOM line is a claim. The designator list on the same line is the evidence. The check counts the evidence and compares.

Definition

What the check is

The reference designator count check compares each BOM line's quantity with the number of unique reference designators listed on that line. R1, R2, R5-R8 expands to six designators, so a quantity of 6 passes. A quantity of 5 or 7 is flagged, and the flag shows both numbers.

What it catches

  • A quantity typed wrong.
  • A designator lost to a page break, a wrapped row or OCR: the list is one short.
  • A range mistyped, such as R5-R8 where R5-R9 was meant.
  • A designator listed twice in one cell, or used on two populated lines.
  • Quantities that rest on no list at all (screws, labels, the bare PCB), shown as not proved by count.

What it cannot catch

  • Two wrong numbers that agree: quantity 4 and four wrong designators.
  • A designator that does not exist on your board. The check has no schematic or netlist.
  • A missing line. The line-count check compares against the document for that.
  • A designator read wrongly by OCR, such as R18 for R13. The count still ties. Look-alike flags apply to part numbers, not designators.

Steps

How the check runs

  1. Split the cell

    Commas, semicolons, spaces, slashes and line breaks separate entries. Dashes, en dashes, .., ~, to and thru mark ranges.

  2. Expand ranges

    R5-R8 and R5-8 become R5, R6, R7, R8. A descending range is expanded and flagged. A range across two prefixes, or longer than 1000, is counted by its endpoints and flagged.

  3. Drop repeats

    A designator listed twice in one cell counts once, and the repeat is reported.

  4. Compare with the quantity

    Equal: the line ties. Different: the line is flagged with both numbers. DNP lines tie at the listed count or at 0.

Worked examples

What the expander returns

These rows were produced by the same function that reads your upload, when this site was built.

Cell textExpandedCountFlag
R1, R2, R5-R8R1,R2,R5,R6,R7,R86
C1-C4C1,C2,C3,C44
R5-8R5,R6,R7,R84
U1 to U3U1,U2,U33
R1/R2;R3 R4R1,R2,R3,R44
R01-R03R01,R02,R033
R8-R5R5,R6,R7,R84range descending
R1, R2, R1R1,R22refdes dup in line
R1-C3R1,C32range mixed prefix
N/A(none)0

Comparison

Counting by hand, a generic converter, and BOMParser

What you needRe-typing by handGeneric PDF-to-ExcelBOMParser
Expand R5-R8In your head.Not done.Every range form listed above.
Compare with qtyLine by line, if you have the time.Not done.Every line that lists designators.
Catch a designator lost at a page breakOnly if you recount.Not caught.Shows as a count mismatch.
Designator used on two linesRarely noticed.Not caught.Flagged with both line numbers.
Show which quantities are unprovedNot tracked.Not tracked.Listed: lines with a quantity and no designators.

"Generic PDF-to-Excel" means tools that copy table cells as printed and know nothing about BOMs. Individual products differ.

FAQ

Designator check questions

What counts as a reference designator?

A letter prefix followed by a number, optionally with a letter after it: R12, C3, U1A, TP5, LED2. Any other text in the cell is still counted as one entry but is flagged as unusual, so a stray word does not slip through.

Which range formats are expanded?

R5-R8, R5-8, R5 - R8, R5–R8 (en dash), R5..R8, R5~R8, R5 to R8 and R5 thru R8. Leading zeros are kept, so R01-R03 gives R01, R02, R03. Separators between entries can be commas, semicolons, spaces, slashes or line breaks.

What happens with a range that runs backwards?

R8-R5 is expanded as R5 to R8 and flagged as descending, because the writer may have meant something else. The flag appears in the Designator ranges check with the line number.

What if a range mixes two prefixes, like R1-C3?

The two endpoints are counted and the range is not expanded, since there is no honest way to expand it. The line is flagged. A range longer than 1000 entries is treated the same way.

Does the check run on DNP lines?

Yes. A DNP line ties when its quantity equals the designator count, or when the quantity is 0 and designators are listed. DNP lines are not counted in the part totals either way.

Why does a line without designators not fail?

Screws, labels, the bare PCB and similar items have no designators. They are listed in 'Quantities backed by designators' as not proved by count, with their printed quantity, so you can see which quantities rest on the BOM's word alone.

What if a designator appears on two lines?

It is flagged in 'No designator used twice', with both line numbers. A DNP alternate that shares a designator with the populated part is allowed and not flagged.

Can the check give a false alarm?

It can when the PDF reader damages the list: a designator lost at a page break or a wrapped row shows as a mismatch although the BOM was right. Compare the flagged line with the PDF before changing anything.

Does it need the schematic or the netlist?

No. It checks the BOM against itself. It cannot tell whether C14 exists on your board, only that the quantity and the list agree.

What about a fractional quantity?

A quantity such as 0.5 can never equal a designator count, so a line that lists designators and has a fractional quantity is flagged. Lines without designators, like 0.5 m of wire, are not affected.