Original TOC_Avg script using the DataNitro add-in in Excel