The transformer losses can usually be classified into two basic categories: losses in transformer core (voltage-dependent losses) and losses in the transformer winding copper (current-dependent losses). By increasing the number of active transformers in the transformer substation we reduce the total losses in transformer copper but on the other hand increase the total losses in the transformer iron core. Considering this, it can be concluded that it is possible to determine the optimum number of active transformers in the substation for each operating condition together with the way they are connected. In this paper, the authors propose novel optimization algorithm which can be used to determine the optimal operating conditions of transformer substation to minimize annual energy losses while avoiding frequent transformer switching and assuring provision of sufficient transformation power in order to supply distribution load. The algorithms which are outlined in this paper are applicable for substations 110/x kV and 35/10(20) kV which have more than one transformer installed with different levels of substation topology complexity (flexibility).