This paper introduces a novel procedure for refining crystal unit cells using powder diffraction scans, requiring no prior knowledge of the crystal structure. The method overcomes least-squares ill-conditioning due to overlapping reflections through the use of constraints. The ultimate result is a list of indexed intensities, which can be used as a starting point for the application of direct methods.