What is the distance between the sun and Neptune? What is the formula used to calculate this distance?
Neptune's is about 29.82 AU from the Sun at perihelion and about 30.32 AU from the Sun at aphelion. This gives an average of about 30 AU.
There isn't a formula as such for calculating the distance. Planetary orbits are roughly elliptical, so if two of the parameters of the ellipse are know, the rest can be calculated.
In fact Neptune has only completed one complete orbit since it was first discovered.
The positions of planets are calculated by numerical integration of observational data. This data comes from Earth based observations, satellites and deep space probes.