The present invention refers to a method for the discrimination of cells from other particles, as well as of different types of cells in raw milk samples by impedance microflow cytometry. More precisely, it describes a method of analysing the quality of raw milk in terms of its bacterial and somatic cell content without the need to pre-treat the milk sample, such that the analysis can take place directly at the production site. One advantage of the invention is discriminating and counting somatic cells from milk particles (consisting mainly of lipid vesicles) by highfrequency impedance analysis directly performed on untreated raw milk. Another advantage of this invention is that the method allows diagnosing the status of a mastitis infection directly after milking according to the analysis of the somatic cell count. Another advantage of this invention is to allow a fast method for determining the bacterial cell count in raw milk directly after milking. In addition, viability of both somatic and bacterial cells can be determined without the need of any cell label. A further advantage is, that the analysis can be obtained in realtime, directly after the raw milk has passed the micro channel of the microfluidic device.