A teaching pro who can analyze swing planes and ball flights can help you narrow the field of clubs and swing properties that can fit your game. Shaft length is a function of a player's height and arm length combined with his swing posture. A shaft sized too short causes a player to hunch over and lose balance. Too long a shaft can cause too flat a swing. Shaft flex, the amount of whip in a shaft and where along the shaft it occurs, can determine how far you hit a ball.
Distance is also a function of swing weight and overall weight.
The lie of the club, the angle between the hosel of the club head and the head itself, is important in making square contact with the ball. You won't realize this any more clearly than after walking into the Callaway Golf Performance Center. In this big box of a room, there are bright lights, a hitting stage, a several high-speed cameras, a computer and a television to which the computer broadcasts a simulation of your ball flight right down the fairway of the 18th hole at Pebble Beach. Callaway has gone to all this trouble because it has the money to do so, wants you to play its extremely popular clubs , and wants those clubs to be what your swing requires. They usually have the wrong flex in their shafts and the wrong loft in their drivers.