Abstract Let f 1 , ⃛, f n be a basis of unit vectors and g 1 , ⃛, g n an orthonormal basis in a Hilbert space. We consider and solve the problem of finding an orthonormal basis e 1 , ⃛, e n such that a weighted average of the distance of e j from f j and g j is minimized in the sense of least squares.