Gibbs free energy ΔG=ΔG°+RTln(Kp) different expressions for ΔG
$K_p$ is normally reserved for equilibrium thus only apples when $\Delta G=0$ and conventionally $Q$ is used otherwise. In a plot of free energy $G$ vs extent of reaction $\zeta$, the slope is $(\partial G/\partial \zeta)_{T,p} =\Delta G$, and equilibrium occurs when the slope is zero then $\Delta G^\mathrm{o} =-RT\ln(K_p)$.  (The extent of reaction is zero with only reactants present, and 1 when one mole of reactants has become product.)

Thus to speak of 'distance' does not mean the energy difference from equilibrium as $\Delta G$ is the slope not the value of the energy $G$ vs $\zeta$.

In the sums you ask about, always calculate products - reactants. The only experimental quantities you have are the concentrations or pressures so it would be possible to calculate $\Delta G$, using your first equation, if the values are known at equilibrium and at some other point. This seems to be what you ask about.