This study presents a ranging algorithm which requires only voltages and currents measured from the two terminals to establish ranging equations. It divides the line into a certain parts and uses every point as failure point to solve three groups of line impedances. When the function which is established by impedance data reaches the minimum, the corresponding point is right the failure point. Simulations show that it can be used for any type of failure and it may not cause ranging error for incorrect parameters.