Density split statistics: Cosmological constraints from counts and lensing in cells in DES Y1 and SDSS