Cell formation (CF) consists of identifying machine groups (MGs) and part families (PFs). Many CF procedures use a part machine matrix as an input and attempt to obtain a block diagonal form. A perfect diagonalization of the part machine matrix to form exclusive PFs and MGs is not possible in many instances. Considering alternate routeings (i.e. alternate plans for the parts and additional copies of machines) improves this diagnonalization. This aspect has not been adequately dealt with in literature. Moreover, existing CF procedures consider indirect measures such as similarity indices, rank order, bond energy etc., that may not obtain a good block diagonalization of the part machine matrix. Also these procedures decouple cell formation and cell evaluation procedures. In this paper a non-linear integer programming model is developed for CF to identify PFs and MGs simultaneously considering alternative routeings. The model combines the evaluation procedure by considering the minimization of a weighted sum of the voids and the exceptional elements in the objective. This leads to better identification of groupings in the existing data. Also, in the model, changing weights for void and exceptional elements gives the designer the flexibility of forming large loose cells (more voids but less exceptional elements) or small tight cells (less voids and more exceptional elements). The model has been illustrated with numerical examples. The optimal solutions for these examples are obtained by solving the linearized version of the model. For efficient solution of larger problems a simulated annealing algorithm is developed.