It is times like this that I really miss SST Toolbox. For all its shortcomings, data manipulation was its strong suit.