Guides

Auto-generate sequential PO / order / ticket numbers in Google Sheets

A running order number that fills itself in as rows are added — no formula to drag down, no counter to reset by accident. Here's how to build one with SmartStamp's custom-value tokens, and where a row-based number stops being safe to rely on.

The usual formula approach — =ROW()-1 or a helper column that adds 1 to the row above — recalculates live, so it renumbers itself the moment a row is deleted, sorted, or inserted above it. A stamped order number is written once and then frozen, the same way a timestamp stamp is: it survives sorting and doesn't shift when other rows change.

Set it up

  1. Extensions → SmartStamp → Settings, tab Configure.
  2. Pick the sheet, the row range, and an edit column to watch — e.g. the column where the order gets a customer name.
  3. Set Stamp target to your order-number column.
  4. Set Stamp value to custom value and enter a pattern such as PO-2026-{row}.
  5. Insert the token from the buttons above the field, or type it directly, then Save.

From then on, every qualifying edit in the watched column gets an order number stamped next to it in one pass — including a whole pasted or filled-down block of new orders.

{row} vs {uuid}

  {row} {uuid}
Looks like PO-2026-14 PO-2026-8f3a2c11-9b4d-4e2a-9c7b-1d5e6f7a8b90
Readable / sequential-looking Yes No
Guaranteed never to repeat No — see below Yes, for practical purposes
Best for A single sheet, human-facing order/ticket numbers An internal key that must never collide, across sheets or systems

{row} expands to the sheet row number at the moment of the edit — short, predictable, and good enough for a number a person reads and types. {uuid} expands to a random unique identifier with effectively zero collision risk, at the cost of being long and non-sequential; combine it with a shorter human-facing {row} number if you want both a tidy label and a bulletproof internal key.

Combine tokens freely: a pattern like PO-{date:eu}-{row} gives an order number that also encodes the day it was created, e.g. PO-04-09-2026-14. See the token list in Settings for every available token, including {email} and {sheet}.

Where a {row}-based number breaks

If any of those matter for your use case — multiple sheets feeding one order sequence, or a hard uniqueness guarantee — use {uuid} instead of {row}, or maintain a single running counter sheet that every other sheet reads from.

Set up your first order-number stamp

One rule, a custom value with {row} or {uuid}, and every new order gets numbered automatically.

See how it works →