The weight of air is affected by the amount of humidity in the air. It would seem that the water is heavier than the air and that water should make the air heavier, but it's not how it looks. Contrary to often a popular belief, humid air is lighter than the dry air providing that both have the same temperature and pressure. Let's have a look at why.
The molecular mass of dry air
N2 - molecular mass 28 - content in the air 78%
O2 - molecular mass 32 - content in the air 21%
Mass of the gas mixture (28x78/100) + (32x21/100) = 28.6
The molecular mass of wet air
Dry Air - molecular mass 28.6 - content in the air 90%
H2O - molecular mass 18 - content in the air 10%
Mass of the gas mixture (28.6x90/100) + (18x10/100) = 27.5
Moist air is lighter and less dense than dry air with the same temperature and pressure. The air that has accumulated moisture becomes lighter and rises to the top. The moist air rises more readily that the dry air.
The reason that the molecular mass can not be substituted by the number of molecules is the Avogadro's law which states that the equal volumes of gases at the same temperature and pressure contain the same number of molecules regardless of their chemical nature and physical properties.