calculate total avrange