It's the entire ride... which includes hills, slowing down, sprinting, etc.

The best way to know your average, is to have a computer that gives it to you. You would be surprised at how you can't really calculate it in your head.

And, if your cycling groups are like ours... if they advertise a 16-18 MPH average... they really average 20-22.