The procedure to calculate the humidity in lb water/lb dry air, is based on an enthalpy balance in the process of cooling air from the DBT to the WBT. For that purpose one needs to know the enthalpies of water at both temperatures, plus the vapor pressure at the WBT, and the prevailing atmospheric pressure. The specific heat of air is generally assumed to be constant at 0.24 Btu/(lb.oF)
As one can see a program can be worked out with the help of steam/water thermodynamic tables, but a single formula, I'm afraid, wouldn't be practical.