In reply to Rick Wicklin.

can do better
no need for substrN() or lag
(see my 6 statement solution, later)