You may just need WhilePrintingRecords in the formula.