How reconciliation works (the math)

The formula NarcCount uses, and the dates it covers.

The formula

For each drug on a count: Expected = Last count + Purchased − Dispensed − Destroyed. Variance = Counted − Expected. A variance of zero means the shelf matches your records.

The dates it covers

Last count is the latest earlier count that included the drug. Purchases, dispensing and destructions are added up from the day after that count through the date of this one.

A drug's first count

With no earlier count there is nothing to reconcile against, so the first count sets the opening balance. From then on the drug reconciles normally.

When expected looks wrong

Expected is only as good as the records behind it. A missing or misdated purchase, fill or destruction moves it, and that gap is what a reconciliation finds.