The Diagnosis and Recommendation Integrated System (DRIS) is a tool to evaluate the nutritional status and obtain fertilizer recommendations of several crops. Unlike other methods, DRIS works directly with farmer’s information, focusing on understanding the nutritional balance of the crop. However, the selection of indexes is long and time-consuming. The objective of this work was to develop an algorithm to estimate reference and DRIS indexes for crops in order to facilitate the use of the DRIS methodology. The construction of the algorithm included four stages, (1) theoretical bases, (2) conceptual model design, (3) algorithm implementation, and (4) validation. For a database of crop yield and foliar analyses, the developed algorithm is divided into two subsets (high and low yield), estimating nutrient ratios and variability. For leaf sample diagnosis, the algorithm compares nutritional balance with highy-ield population, generating DRIS indexes numerically and graphically. A nutrient is imbalanced if its DRIS index in the graph is outside the whiskers. The efficiency and operability of the algorithm was tested with foliar analyses of fifty plantain crops distributed in two subregions of the Antioquia Department, Colombia. The developed procedure allowed determining quantitative and graphical information of the nutrient balance in foliar samples.