Lot and Serial Number Traceability: Finding Every Customer in a Recall
In a recall, the answer to “which customers received this lot?” depends on three records being linked: the lot on the raw material receipt, the production orders that consumed it, and the shipments of the finished lots those orders produced. Keep that link as one row per order and lot pair, and capture the lot by scanning or picking from a list rather than typing it, and the trace is a single query. Type the lot into one cell per order and the link breaks. The filter then returns a short list instead of an empty one, and nobody notices what is missing. Below I walk through one fictional month at a food packaging plant where a single adhesive lot reached 9 customers, the spreadsheet trace missed 4 of them, and the mass balance exposed the gap.
What is the difference between a lot and a serial number, and what do forward and backward traces ask?
A lot is a group of items received or produced under the same conditions; a serial number identifies one unit. Film reels, inks, adhesives, chemicals and packaging shipped by the carton are traced by lot. A pump, a machine or a spare part under warranty is traced by serial number, and the components inside that unit still carry lots. A fictional example: three pumps with serial numbers P-0417, P-0422 and P-0430 carry the same seal lot (CT-58). If a warning arrives for CT-58, the customers of the first two in the field are contacted and P-0430 in the warehouse is put on hold; the lot-tracked component reaches the customer through the serial-tracked unit.
Traceability asks two questions:
- Forward trace (recall): raw material lot → production orders → finished lots → shipments → customers. “The supplier issued a warning on this lot. Who received how much?”
- Backward trace (complaint): finished lot at the customer → production order → every raw material lot used → suppliers. “Which lots went into the carton that triggered the complaint?”
What makes this hard is that the links are many-to-many. One raw material lot feeds several orders (a split lot). One order consumes two raw material lots when a new lot is opened mid-run (a merged lot). One order spread across two shifts yields two finished lots. A single “raw material lot” cell per order cannot hold a merged lot.
Example: which customers received adhesive lot YP-2207?
The plant, figures and codes are fictional. Every calculation was checked with a script.
Each month the plant receives 64 raw material lots, opens 38 production orders and writes 117 shipment lines. During the month the adhesive supplier issues a warning on lot YP-2207, 800 kg. Testing the product and deciding whether to reject it are outside this page. The only question here: where did this lot go?
With correct records the trace returns:
| Finished lot | Order | Shipment lines | Customers |
|---|---|---|---|
| BU-1103 | UE-1103 | S1, S2, S3, S4 | M-01, M-02, M-03, M-04 |
| BU-1106A | UE-1106 | S5, S6 | M-01, M-05 |
| BU-1106B | UE-1106 | S7, S8 | M-05, M-06 |
| BU-1109 | UE-1109 | S9, S10 | M-02 |
| BU-1112 | UE-1112 | S11, S12 | M-07, M-08 |
| BU-1115 | UE-1115 | S13, S14 | M-09 |
In total: 5 production orders, 6 finished lots, 550 cartons, 14 shipment lines and 9 customers. The shipment lines add up to 533 cartons, but the 3 cartons M-02 returned went out again to M-04 on line S4, so they are counted twice; net shipments are 530 cartons. The remaining 20 cartons, all from BU-1112, are in the warehouse, and placing them on hold is the first action.
Backwards, UE-1112 used two adhesive lots: after taking 150 kg from YP-2207, the operator opened YP-2231 while 60 kg was still in the YP-2207 drum. That remaining 60 kg sat in the open drum and was used up in UE-1115. If YP-2231 ever receives a warning, BU-1112 appears on that list too.
The mass balance is the check on the drill: the quantity received must match the quantity booked to orders. YP-2207 came in at 800 kg, and the orders consumed 180 + 260 + 150 + 150 + 60 = 800 kg. When the balance closes, the trace is complete.
How is this usually kept in Excel, and where does it break?
The example plant’s workbook has one “raw material lot” cell per order on the production sheet and a typed lot column on the shipment sheet. Kept that way, the same month has six broken links:
- Merged lot: for UE-1112 the operator wrote only the drum opened mid-run, YP-2231. YP-2207 never appears.
- Typing variation: UE-1115 says “YP2207”, with no hyphen.
- Return: the 3 cartons returned by M-02 went to M-04 on S4, and the line has no lot.
- Typing variation: S7 reads “BU-1I06B”, a capital I instead of the digit 1.
- and 6. Partial shipments: S10 and S14 are second deliveries. The line was copied and the lot cell left empty.
An exact-match filter on “YP-2207” finds 3 orders (UE-1103, UE-1106, UE-1109). Those yield 4 finished lots, and 7 of the 14 shipment lines appear. Five customers are found. M-04, M-07, M-08 and M-09 are missing. The 20 BU-1112 cartons in the warehouse are invisible too, so nothing stops them from shipping.
A “contains 2207” search catches UE-1115 but still misses UE-1112, because that number is not written in its cell at all. A looser search can make up for a typing variation. It cannot recover a link that was never recorded.
The mass balance is what reveals the gap. The three orders found consumed 590 kg against 800 kg received. Nobody can say where 210 kg went. If you run drills in Excel, the drill is finished when the balance closes, not when a customer list appears.
Can Excel be set up more robustly?
Yes. Three rules remove three of the six breaks above and flag the other three:
- One row per order and lot pair in the consumption table. Columns: Order, Lot, Kg. UE-1112 becomes two rows: YP-2207 150 kg and YP-2231 60 kg.
- Pick the lot from a list. If the Data Validation list draws on the lots in the receipts table, “YP2207” and “BU-1I06B” are rejected.
- Flag empty lots with a check column. Data validation does not catch a cell that is never filled in. Add
=IF(ISBLANK([@FinishedLot]),"NO LOT","")to the shipment table and complete those lines from the delivery notes before a drill.
In Excel 365 a forward trace takes three formulas, and a fourth gives the mass balance. The tables are Consumption, Output (order and finished lot) and Shipments, and the lot being traced sits in B1:
H2: =UNIQUE(FILTER(Consumption[Order],Consumption[Lot]=B1))
I2: =FILTER(Output[FinishedLot],COUNTIF(H2#,Output[Order])>0)
K2: =FILTER(Shipments,COUNTIF(I2#,Shipments[FinishedLot])>0)
L1: =SUMIF(Consumption[Lot],B1,Consumption[Kg])
H2 lists the orders, I2 their finished lots and K2 the shipment lines for those lots. L1 gives the mass balance. Kept this way, the same month returns all 5 orders and 6 lots. Of the 14 shipment lines, 11 come back and 3 are flagged “NO LOT”. Only M-04 has to be added by hand, because its single line is S4.
The limits of this setup: a pasted value overrides data validation. When production, warehouse and shipping write to the same workbook at once, it is hard to tell who changed what. There is no scanning. For stock balances and counts, the movement table in Excel inventory tracking follows the same logic.
Recall drill: how many minutes does it take you to trace a lot end to end?
Run the drill on a randomly chosen lot, in both directions, with a clock running, and record three results: time, coverage and quantity gap. Who must have a traceability system depends on the sector:
- Food (EU): Article 18 of Regulation (EC) No 178/2002 requires knowing who supplied you and whom you supplied. The Food Safety Authority of Ireland (FSAI) describes this as a one-up-one-down system and notes that tracing to batch level is not a legal requirement, but that without lot tracing a recall may have to cover every product with the same name (FSAI, read 2026-10-31).
- Food sold in the US: the FDA Food Traceability Rule (FSMA 204) covers certain foods and requires records to be provided within 24 hours of a request, as an electronic sortable spreadsheet when needed during an outbreak or recall. The original compliance date was 2026-01-20; under a Congressional directive, the FDA will not enforce the rule before 2028-07-20 (FDA, read 2026-10-31).
- Pharmaceuticals and medical devices have separate reporting systems; do not judge their scope from this page, and the application described here does not replace them.
- Spare parts, machinery and chemicals: the requirement often comes from the buyer’s contract or quality system. Read it from that document.
In Turkey, Article 24(1) of Law No. 5996 requires food and feed businesses to keep a tracking system at every stage and to provide the information to the Ministry on request; the paragraph sets no time limit (read from the consolidated text on mevzuat.gov.tr, 2026-10-31).
I am not giving you a target number of minutes. A binding time can only come from the rules you are subject to or from your buyer’s written requirement, and your first drill sets your own baseline. Pick a hard lot on purpose: one involving a return, a partial shipment and a merged lot, like YP-2207 in the example. With an easy lot, even the spreadsheet finds 14 lines out of 14 and the problem stays hidden.
How should barcodes, lot formats, FEFO and partial consumption work?
Capture the lot number correctly once, at receipt, and scan it at every later step; that is the lasting fix for typing variations. The rules below can be built into an application this way, and some can also be applied by hand in Excel.
- Scan at receipt: GS1 barcodes carry the batch or lot number in AI (10), up to 20 characters, the expiry date in AI (17) as YYMMDD, and the serial number in AI (21), up to 20 characters (GS1 Application Identifiers, read 2026-10-31). If the supplier’s label lacks this, print your own lot label at receipt.
- Lot format validation: define a rule such as “YP- followed by four digits”. “YP2207” and “YP-22O7”, with a letter O in place of a zero, are refused.
- FIFO and FEFO: FIFO uses the oldest receipt first; FEFO uses the nearest expiry first. In the example, when a new drum was opened during UE-1112, the open YP-2207 drum still held 60 kg, and YP-2219 (41 days to expiry) and YP-2231 (96 days) were on the shelf. The operator opened YP-2231. Two risks show here: an open drum can be forgotten, and under FEFO YP-2219 should have been opened first. A FEFO rule can warn at that point and flag the open drum as “finish this first”; an operator who still goes ahead records a reason.
- Partial consumption: an 800 kg lot is not used up in one order. Each order books the kilograms it consumed and the remainder shows on the lot. When UE-1115 takes the last 60 kg, the lot reaches zero and closes. Booking more than the remainder can be refused.
- Partial shipments and returns: every delivery line carries its own lot. A return is not a deletion but a new movement linked to the original shipment: the 3 cartons back from S2 leave on S4 with the same lot.
Is a spreadsheet enough for lot tracing, or do you need a web application?
| Route | When | Limit |
|---|---|---|
| Excel, one lot cell per order | Lot tracing not required, raw materials never mixed | Merged lots and typing variations disappear silently |
| Excel, row per pair, list selection | One person enters data; drills show full coverage and a closed balance | No scanning, pasting overrides rules, concurrent edits are hard to trace |
| ERP lot module | Your ERP already records lots and expiry dates | An optional lot field stays empty |
| Custom web application | Separate people book receipts, production and shipping; scanning and FEFO needed | Needs a written scope, a server and maintenance |
When you do not need a web application:
- If your ERP has a lot module, switch it on first and make the lot field mandatory. A separate application will not fill an empty field in the ERP on its own.
- If your production setup never puts the lot in the operator’s hands (no labels, no readable number on the drum), an application alone will not fix that. Labelling comes first.
- If two drills in a row on a row-based workbook show full coverage and a closed balance, and your buyers do not ask you for lot reports, stay in Excel.
When to consider one:
- Different people record receipts, consumption and shipments.
- Drills turn up typing variations or empty lot lines.
- Raw materials have expiry dates, or buyers ask for lot lists during audits.
- An intermediate lot is created between raw material and finished product (blending, pre-treatment, rework). A two-level chain cannot be built with these three tables; the intermediate lot is written into the scope separately.
What could an application for this include?
It can be built around your needs; the scope is defined in writing at the first step. For the plant in the example, possible screens:
- Receipt: scanning, lot format check, expiry date and, where needed, printing an internal label.
- Consumption: order, lot and kilograms on separate rows, a FEFO warning, the remaining quantity per lot.
- Shipping: the lot is scanned onto each delivery line; partial shipments and returns link to the original movement.
- One search screen: forward and backward traces, the mass balance, and a hold on remaining stock.
- Drill log: the lot chosen, the time taken, coverage found versus actual.
Roles can be split into warehouse, production, shipping, quality and management. Holds and corrections require a reason, and every change records who made it and when.
AI can read the lot number and expiry date from a supplier’s delivery note or certificate of analysis and propose them on the receipt screen. When old spreadsheet records are imported, it can suggest matches such as “YP2207 → YP-2207?”. The quality lead approves each suggestion. A link that was never recorded, like the one in UE-1112, cannot be inferred by a model either; on import it stays marked as missing.
The application would run on a virtual private server (VPS) that can be opened in your company’s name. The records would be yours and can be exported to Excel or CSV at any time. Small and mid-sized teams pay no per-user licence; the cost is the server and maintenance. The source code goes into a repository you can access, with run instructions, a dependency list and known limitations. Connections to an ERP, label printer or handheld scanner are agreed in writing as part of the scope. The general approach is on custom web applications for your team. Counting the cartons left in the warehouse and comparing them with the records is a separate job, covered on barcode inventory counts.
The first consultation is paid. To discuss scope, get in touch with three facts: how many raw material lots arrive in a month, where production and shipment records are kept today, and how many shipments your last drill found.
Points I have not verified
I read the sources on 2026-10-31. I have not tested the following in a real workbook or a primary text:
- I did not run the formulas in Excel 365; the logic was checked with a script.
- I could not open the text of Article 18 of Regulation 178/2002 on EUR-Lex and relied on the FSAI summary.
- I did not review the traceability and reporting provisions for food contact materials (packaging included), pharmaceuticals or medical devices in a primary source.
Frequently Asked Questions
Should we use the supplier’s lot number or assign our own?
Keep both. The supplier’s lot stays on the record as a field, because warnings arrive under that number. Assigning your own lot code at receipt means two suppliers using the same number cannot collide, and the format follows your rule.
How large should a finished lot be?
Smaller lots narrow a recall but add labels and records. You can close a lot at the end of a shift, a day, or whenever the raw material lot changes; in the example, UE-1106 opened two lots for two shifts. The FSAI points out that using the best-before date as the lot code pulls every product carrying that date into a recall.
When should we move to serial number tracking?
Move to serial numbers when units are serviced individually in the field, when warranty works per unit, or when buyers ask for unit-level records. Serial histories are not written retroactively onto old records that only ever held lots.
How do I work?
Work-hour packages
Tell me about your business and what you need on WhatsApp or by phone; we agree on a work block of somewhere between 5 and 40 hours and I start doing what is needed. What you get is not a calendar window — it is net working hours spent directly on your business. I can use 40 hours working three days straight, or deliberately spread it out and finish it over a year — whatever the work calls for. I do not spend my time estimating how long something will take, I spend it doing the work; every hour I spend leaves a lasting result in your business. We keep going for as long as you find it useful.
Why not monthly?
Is 40 hours a week?
On a fixed monthly fee both sides are watching the wrong thing: you watch a fixed cost, the other side watches how many more contracts like this they can line up. Working by the hour puts us both in front of the same thing — the real value of the work that got done. I know not having an upfront answer to "how much will this cost in total?" is the natural cost of this model. But instead of paying a fixed fee for months to a setup that is not producing results, you only pay for the qualified time spent on your work — and you see exactly where that time went, start to finish. That is why my clients keep coming back.
