We present an explicit formula relating volumes of strata of meromorphicquadratic differentials with at most simple poles on Riemann surfacesand counting functions of the number of flat cylinders filled by closedgeodesics in associated flat metric with singularities. This generalizes the resultof Athreya, Eskin and Zorich in genus 0 to higher genera.