Check out the search feature: https://root-forum.cern.ch/search?q=average%20histogram
Gives this complicated discussion:
And this simpler solution: