This article addresses the problem of designing rotation schedules for the training of medical students in a healthcare institution in Colombia. Rotations are carried out along the course of a six months time period during which students rotate through different services both during one or multiple fortnightly periods. The hospital receives trainees from different universities that present heterogeneous requirements, and must accomplish different rotations constraints even in those cases when they come from the same university. Two different approaches are proposed to tackle the problem. First, a mathematical programming model is considered. Secondly, a metaheuristic approach based on Variable Neighborhood Search is adapted to solve the problem in an efficient manner. In both cases the objective function is proposed to be either a linear or a quadratic function that seeks a stable allocation of personnel to the services all along the considered time horizon. The proposed techniques are implemented as a part of a basic spreadsheet that helps personnel in charge generate, validate and fix the proposed plans as needed. The effectiveness of the methodology is tested through ex-post analysis, comparing it against schedules generated by the personnel in charge at the hospital, and over simulated data. The results indicate that the applied metaheuristic is competitive against specialized optimization software and facilitates the work of optimization for the health professionals in charge, reducing the planning tasks from several days to minutes.