To detect the positions of a plurality of areas on substrates with high accuracy at a high throughput in the treatment of one lot of substrates.
For the wafers before the n-th substrate (n≥2) in one lot, the positions of all shots are detected and each misalignment is divided into a nonlinear component and a linear component (steps 108-112) and the nonlinear distortions of the wafers are evaluated by using the misalignment and an evaluation function and the nonlinear components of the misalignment of all shots are calculated, based on a complementary function decided on the basis of the evaluated results (steps 114-118). For the wafers after the n-th wafer, the position coordinates of all shots for which the linear components of the misalignment are corrected by EGA are calculated (step 120). Then the positions of the shots are detected, based on the position coordinates of all shots for which the linear components are corrected and the nonlinear components calculated in the step 118 (step 122).