Fluorescence correlation spectroscopy (FCS) has become an important technique in biophysical research, which is also used for in vivo studies of molecular mobilities in cells. We theoretically study how confinement or exclusion of the diffusing fluorescent molecules by a spherical region influences the measured autocorrelation function in an FCS experiment. It is shown that close to the boundary of the spherical region the diffusion time can be significantly changed due to the geometric restriction of the detection volume. This is important when quantitatively evaluating and interpreting FCS measurements in cells.