Well conditions are just about everything. I used to commute 12 miles one way. I think my lowest average speed was something like 7 miles per hour into a howling headwind. My highest average speed was 27 mph and I probably could have broken 30 with a warm up beforehand. Climbs will really reduce average speed also. I think I averaged something like 5 mph up Teton Pass in Wyoming.
On flat rides, I can average about 18. To average a certain speed, you have to cruise faster than your average by about 2 mph or even more. In the loop through the area I live in, even on fast group rides, I have never been able to average over 20 mph (or at least I don't recall it). Out in rural areas where one can cruise for long distances, averaging over 20 is not that hard in a group.