Stratified sampling is a technique that consists in separating the elements of a population into nonoverlapping groups, called strata. This paper describes a new algorithm to solve the one-dimensional case, which reduces the stratification problem to just determining strata boundaries. Assuming that the number L of strata and the total sample size n are predetermined, we obtain the strata boundaries by taking into consideration an objective function associated with the variance. In order to solve this problem, we have implemented an algorithm based on the iterative local search metaheuristic. Computational results obtained from a real data set are presented and discussed.