Hi and welcome

would a Pivot Table do? ( perhaps post a sample heet showing BEFORE and AFTER)