The formula applied in diffraction gratings is:
dsin(θ) = nλ
where d is the distance between two adjacent openings in the grating, θ is the angle between two minima or maxima of light, n is the order of the maxima or minima formed and λ is the wavelength of the light being diffracted.