© 2018 American Physical Society. We derive cosmological constraints from the probability distribution function (PDF) of evolved large-scale matter density fluctuations. We do this by splitting lines of sight by density based on their count of tracer galaxies, and by measuring both gravitational shear around and counts-in-cells in overdense and underdense lines of sight, in Dark Energy Survey (DES) First Year and Sloan Digital Sky Survey (SDSS) data. Our analysis uses a perturbation theory model [O. Friedrich, Phys. Rev. D 98, 023508 (2018)10.1103/PhysRevD.98.023508] and is validated using N-body simulation realizations and log-normal mocks. It allows us to constrain cosmology, bias and stochasticity of galaxies with respect to matter density and, in addition, the skewness of the matter density field. From a Bayesian model comparison, we find that the data weakly prefer a connection of galaxies and matter that is stochastic beyond Poisson fluctuations on ≤20 arcmin angular smoothing scale. The two stochasticity models we fit yield DES constraints on the matter density Ωm=0.26-0.03+0.04 and Ωm=0.28-0.04+0.05 that are consistent with each other. These values also agree with the DES analysis of galaxy and shear two-point functions (3x2pt, DES Collaboration et al.) that only uses second moments of the PDF. Constraints on σ8 are model dependent (σ8=0.97-0.06+0.07 and 0.80-0.07+0.06 for the two stochasticity models), but consistent with each other and with the 3 x 2pt results if stochasticity is at the low end of the posterior range. As an additional test of gravity, counts and lensing in cells allow to compare the skewness S3 of the matter density PDF to its ΛCDM prediction. We find no evidence of excess skewness in any model or data set, with better than 25 per cent relative precision in the skewness estimate from DES alone.