  Hydroxyl ($\rm OH$) is known to form efficiently in cold gas ($T\sim 100$K)
along with the molecule $\rm H_2$ and can be used as an efficient tracer of the
diffuse molecular gas in the interstellar medium (ISM). Using a simple
formalism describing the $\rm H\,I/H_2$ transition and a reduced network of
major chemical reactions, we present a semi-analytical prescription to estimate
the abundances of O-bearing molecules in the diffuse ISM. We show that
predictions based on our prescription are in good agreement with the estimates
obtained using the MEUDON PDR code which utilizes the full reaction network. We
investigate the dependence of the relative abundances of $\rm OH/H\,I$ and $\rm
OH/H_2$ on the variations of physical conditions i.e., the metallicity, number
density ($n$), cosmic ray ionization rate ($\zeta$) and strength of UV field
($\chi$) in the medium. We find that the $\rm OH/H\,I$ abundances observed in
the Galactic ISM can be reproduced by models with $n\sim 50$cm$^{-3}$,
$\chi\sim 1$ (Mathis field) and $\zeta\sim3\times10^{-17}$s$^{-1}$, with a
variation of about one dex allowed around these values. Using the constrained
$\rm H_2$ column density distribution function at $z\sim3$, we estimate the
$\rm OH$ column density distribution function and discuss future prospects with
the upcoming large radio absorption line surveys.
