It is pretty complex as you need to take into account the
gear ratio
final drive ratio
wheel/tyre size
When you are looking at distance to get max RPM you will then need to take into account the weight and power of the car and factor in transmission losses.
Perfect setups will invlove a rolling road session to highlight the power band and then you calculate your cog sizes for speed/rpm to coincide with your power band.
I did see a downloadable ratio calculator but although it is complex it is unlikely to do everything you want.
I built a quarter mile time calculator in the Tools section and this is pretty complex so I can only imagine the maths involved in gear ratio's.
If someone can come up with a formula I should be able to build this into a calculator for you
