The yield and quality decrease due to high somatic cell counts caused by mastitis, and this also negatively affects the profitability, efficiency, and sustainability of dairy farms. The main objective of this study was to investigate the effects of somatic cell counts on yield, milk chemicals, and the technical efficiency of Holstein dairy cows. A total of 165 lactating cows were involved in the research, and all cows were fed the diets as a total mixed ration three times a day. Milk samples were collected each day during milking and analyzed for chemical composition and somatic cell counts (SCC). The daily milk production of each cow was obtained from the SCR herd management program, which is integrated with the parlor. In conclusion, it was determined that for each group, the efficiency scores, SCC, and milk yield of cows varied between 0.80 and 0.99, 322.000 and 557.857 cells/mL, and 33.13 and 48.90 Kg/d, respectively; they also differed significantly in each group. Considering the findings, milk production can be increased by 7% without changing any input. Additionally, every 1% decrease in SCC will increase the efficiency of milk production by 0.55%. Cows with low technical efficiency (TE) scores produced 2.87 kg/d/cow less milk compared to animals with high TE. Reducing the SCC of the group with a low TE (456.878 cells/mL) to a SCC of high TE (438.869 cells/mL) will increase milk yield by 2.87 kg/d/cow on average. In conclusion, minimizing losses due to mastitis is paramount for enhancing dairy farm efficiency. This research underscores the interplay between TE and udder health, providing a comprehensive understanding of individual cow performance. Addressing inefficiencies and promoting udder health can significantly contribute to sustainable and economically viable dairy farming practices. Keywords: Dairy farm; Mastitis; Somatic cell count; Stochastic frontier analysis; Technical efficiency