I struggled immensely with the math on this one, so I took a look at the solution and WOW it is impressive! I still have a lot to learn...
...but I optimized the solution for functions that we have today (able to set RecordID starting value, retaining special characters in Crosstab, etc.)