Embed Excel formula comments directly into your math using the N and REPT functions to keep your spreadsheet documentation ...
PIVOTBY is great for analysis, but PivotTables still have the edge when formatting needs to adapt to data changes.
If you can write an Excel formula, you can build your own function.