Job shop manufacturing environments are using the concept of cellular manufacturing systems(CMS) which has several advantages in reducing production lead times, setup times, work-in-process, etc. Utilizing the similarities between cell-machine, part-machine, and the shape/size of parts, CMS can group machines and parts resulting in improved efficiency of this system. However, when grouping machines and parts in machine cells, there inevitably occurs exceptional elements(EEs), which can not operate in the same machine cell. Minimizing these EEs in CMS is a critical point that improving production efficiency. Constraints in machine duplication cost, machining process technology, machining capability, and factory space limitations are main problems that prevent achiving the goal of maintaining an ideal CMS environment. This paper presents an algorithm that minimizes EEs under the constraints of machine duplication cost and factory space limitation. Developing exceptional operation similarity(EOS) by cell-machine incidence matrix and part-machine incidence matrix, it brings the machine cells that operate the parts or not. A mathematical model to minimize machine duplication is developed by EOS, followed by a heuristic algorithm in order to reflect dynamic situation resulting from minimizing exceptional elements process and the mathematical model. A numerical example is provided to illustrate the algorithm.