In order to generate a single preference order for the society, a set of operations must be made on the preferences of the individuals forming that society. The aim of this paper is to propose a new Social Choice Function - SCF which will do this procedure. There are numerous functions that do this based on different intuitions or ideas. The function proposed in this paper has been developed with the intuitive approach that is based on the distances of the candidates to the ranks retrieved from the voters' ranking (as in the function of Cook & Seiford). The proposed function has a rather simple algorithm which, at each step, assigns a candidate to the closest possible rank while considering that distance has been covered for the next iteration. The function's process is designed in such way that the function will try to solve as much as possible the cases where there is indifference between candidates.