Discussion thread for day 15 of the Advent of Code : https://adventofcode.com/2020/day/15
Realised I had never posted my solution to Day 15. This one took me a lot of debugging as I went for the option of generating a longer string with generate rows and multi-row formulas to go through the 2020 Elf answers and avoid an iterative macro. The result is a run time of 1.2 seconds, however it's not fast enough for the part 2.
The formula for the multi row is, does a string walk with all numbers padded to strings of a fixed length of 4 and split by a pipe delimiter:
IF ISNull([Row-1:Data]) THEN [Data] ELSEIF
findstring(substring([Row-1:Data],0,([Row-1:RowCount]-1)*5),substring([Row-1:Data],5*([Row-1:RowCount]-1),5))=-1
THEN
[Row-1:Data]+"|0000"
ELSE
[Row-1:Data]+"|"+padleft(tostring(([RowCount]-1)-((length(right(reversestring([Row-1:Data]),Length([Row-1:Data])-5))-(findstring((right(reversestring([Row-1:Data]),Length([Row-1:Data])-5)),left(reversestring([Row-1:Data]),5))))/5)),4,"0")
ENDIF