For a batch of ticket codes, the year digits change from 24 to 26. The serials stay as assigned. A position-based edit changes the year segment even if 24 also appears inside a serial.

Count from the left in a sample code

In TK24-007, TK occupies positions 1 and 2, 24 occupies 3 and 4, and the hyphen is position 5. If every input follows that structure, put the original code in A2 and use:

=REPLACE(A2,3,2,"26")

The code TK24-007 is split into a two-letter prefix, two year digits, a hyphen and three serial digits.

Illustrated character positions. Count from the first character as position 1.

Check a serial that also contains 24

TK24-007 should become TK26-007. Try TK24-124 too. It should become TK26-124, with the serial untouched. Check any row that has a different prefix length, a missing hyphen or a stray space before filling down. Keep the original column for comparison.

The output is TK26-007. TK and the three-digit serial 007 still match the source.

Illustrated check. Compare the untouched segments, including leading zeroes.

Microsoft’s Excel function reference