We apply Gans theory to fit the absorption spectra of gold nanorods with aspect ratios R <= 2.5 in solution using both the longitudinal and transversal surface plasmon resonance absorption peaks and the dielectric constant of the medium, epsilon(m) , as a fitting parameter. By fitting the broadened absorption peaks using the absorption spectra of a set of nanorods with a range of aspect ratios, we determine the size distribution of the nanorods in solution. The optimum value of epsilon(m) = 2.1 +/- 0.1 is substantially higher than the dielectric constant of the solvent (epsilon(m,water) = 1.77), which is most likely due to a change in the effective dielectric constant in the vicinity of the nanorods. The validity of our method is confirmed by comparing the calculated size distributions with transmission electron microscope images, and we obtain a good agreement between the experiments and our calculations. Furthermore, several other recent experimental results are compared with our fitting method, and we find that the discrepancy between Gans theory and those experimental results can be explained by using higher values of E.