Measurement of differences in optical path length in monochromatic light with any interferometric method is insensitive to errors that are whole numbers of waves. If measurements are performed in several wavelengths, this ambiguity can be resolved. We present a general algorithm for finding the correct distance post facto, given multiple measurements in different wavelengths. Applied to piston measurements of a segmented mirror, the capture range of a wavefront sensor can be extended from ± half a wave to several waves. The extended capture range can be calculated and depends on the selection of wavelengths used for measurements and the expected accuracy of the method used.