Perfect use case for the Crew Macro - Dynamic Formula.
A lot more efficient than other ways, especially if we were to be playing with more than 100 rows of data.
Also keeps the field order as well.
Take a look into the macro - it's modifying the XML, kudos to @AdamR in creating this years back!
Nice challenge. Tricky getting the output column order correct.