A return log can show the same crate on several days. Number each appearance of that crate in the current log order, even if other crate IDs appear in between.
Count matches from the first row through this row
Put the crate IDs in column A. In B2, enter the formula below and fill down:
=IF(A2="","",COUNTIF($A$2:A2,A2))The first endpoint stays fixed. The second expands one row at a time. The IF keeps a blank ID row blank in the result.

Illustrated log. A different ID between repeats does not reset the count.
Check separated repeats and the final range
Enter CR-4, CR-9, CR-4 and CR-4. The results should be 1, 1, 2 and 3. The final formula should count through A5. COUNTIF treats wildcard characters in its criteria specially, so this example uses IDs with letters, digits and hyphens.

Illustrated reference check. Inspect the first and last copied formulas.
Keep the log sorted in the sequence you want to number. Sorting it differently can change which appearance receives each number.



