Dear student,
The chemical formula is defined for a particular chemical compound or molecule, it is not defined for a river or any other substance. However, the Ganga river mainly consists of water and the chemical formula of water is H2O. It also contains different types of impurities.
Regards