This study aims to develop an Excel programming model to formulate feed for Nile tilapia (Oreochromis niloticus), mainly for small- and medium-sized fish feed manufacturers. The model allows users to formulate the least costly balanced diet of Nile tilapia species, giving them the ability to choose a specific ingredient in the formulation according to the realities of the local environment: space-temporary availability of ingredients, prices and nutritional quality. Computer programming of a database of 25 locally available feed components was carried out using the Excel Solver Add-in and Excel IF mathematical functions to incorporate/delete specific ingredients in real time in accordance with user objectives. The theoretical characteristics of the least-cost balanced diets performed were within the margin of the nutrients requirement of the target fish size with protein levels of 35 per cent (fry diet: $1.07/kg), 32 per cent (fingerlings diet: $0.48/kg), 29 per cent (growth diet: $0.43/kg) and 27.12 per cent (final diet: $0.39/kg). The digestible energy of these diets was between 3016.5 ± 93.8kcal. In addition, the model shows that an increase in soya meal prices by 75 per cent led the local feed industry to rely on imported fish meals, as the number included reached 52.28 per cent. However, the cost of the diet margin did not vary significantly. Nevertheless, it would be important to test the balanced diet developed with the model before production and scaling.