The Challenge
The laboratory runs analytical tests on samples sent in by their customers. Every batch run on their analysers produces a data file, and the results then have to be copied into the lab's quality-control charts, checked against acceptance limits and written onto each sample's results form. All of these are controlled forms in the lab's quality system.
That copying was done by hand. It took a scientist's time on every batch, and with dozens of analytes, two injection volumes and several limits to check, it was easy to pick up a value from the wrong column. Meanwhile, the customer service team was emailing customers about due dates and cases on hold one at a time.
Scoping: Written Rules, Checked Line by Line
The lab's technical lead wrote a detailed brief for each macro, setting out which cell each value comes from and which rule applies. We read every brief against real data files before quoting and queried anything that didn't add up, such as a column reference that pointed at text rather than numbers, or a rule that gave a different answer for one analyte. Several of those questions caught errors in the brief before any code was written.
Each job had its own fixed price: the first control-chart macro, then a 3-hour add-on for the batch review sheet, then 5 hours for the results form and database. Small changes found during testing were added at half an hour or an hour at a time, always agreed first.
What We Built
- Control charts filled from the analyser. The macro reads the batch data file and writes each quality-control result onto the right analyte's control chart, using the correct injection volume for each analyte.
- Batch review ticks and crosses. It then fills the batch review sheet, placing a tick or a cross against each check: spread against a 15% limit, blank samples below their cut-offs, and calibration and QC samples passing or failing.
- Results forms and a results database. For each sample, a second macro works out which value to report from the two injection volumes, leaves results below the reporting level blank and flags results above the calibrated range as extrapolated. Results then go into a database tab with a sheet for each of around 30 analytes.
- A scientist stays in control. Before each sample's results are added to the database, the macro asks for authorisation. A rejected result is kept out of the database and marked on the form, and the macro moves on to the next sample.
- Protected logic. The macros are password-protected so they can't be changed without authority, while the spreadsheets stay open for normal use.
- Customer emails from the case tracker. A right-click sends due-date or on-hold emails to one customer or a whole batch, only when the case status and an email address allow it, and records that each email has been sent so no customer gets it twice.
The customer service team then asked for emails to come from the shared info address, so customers wouldn't reply to whoever happened to send them. That took some research, and we split the time with the client.
The Result
A batch that used to mean copying hundreds of values by hand now takes a button press, with every pass and fail decision applied the same way each time and a scientist still approving what goes into the database. The case tracker sends customer updates in batches instead of one by one.
The approach spread through the lab. We went on to build control charts for further test types, a workplace testing tracker, an employee training tracker, case notes and testing forms, a second case tracker and reporting links. The case tracker was still being extended three years after it was first adapted, by then on its sixteenth issue.
Why Excel, and Not a LIMS?
Laboratory information management systems are built for this kind of work, and larger labs often run one. They are also expensive and slow to change. This lab's quality system was already built around controlled Excel forms that its scientists knew well. Automating those forms removed the error-prone copying without changing a validated process or retraining staff.
Macros like these depend on the layout of the instrument files and forms, so when a method or form changes, the macro needs a matching update.
Could This Work for Your Organisation?
The same approach suits any laboratory or testing business that moves instrument results into spreadsheets: clinical and environmental testing, food and water analysis, forensic labs and manufacturing QC. If your scientists copy values from analyser exports into control charts or results forms, a macro can do it in seconds and apply your acceptance rules consistently. Send us a sample data file and form, and we can usually get back to you with a fixed price within 24 hours.
Questions About Automating Lab Data in Excel
Can Excel read data files exported from our analysers?
Usually, yes. Most instrument software exports to CSV or Excel. A macro can read the export, find each sample and analyte, and copy the values to the right place in your control charts or forms.
Can it apply our acceptance criteria automatically?
Yes. Rules such as spread limits, cut-offs, calibration ranges and pass or fail checks can be written into the macro, which then marks each result consistently. We check every rule with you against real data before relying on it.
How do we keep a scientist in control of the results?
Build in an approval step. In this project, the macro asks for authorisation before adding each sample to the results database, and rejected results are kept out and marked on the form.
Can customer emails be sent from the same spreadsheet?
Yes, through Outlook. Emails can be sent singly or in batches, only when the case status allows it, and the sheet records which emails have gone so nobody is contacted twice.
What does lab automation like this cost?
We quote a fixed price after a free scoping call, and you only pay once you are happy with the finished work. At our current rates, a similar project would typically cost $2,200–$2,600.
