The estimation of activity is pretty straightforward and not really at the same time..
The correct equation to use is this:
$$\dot{N}=A\cdot n_\gamma\cdot \frac{\varepsilon}{4\pi r^2}\cdot \exp(-\mu_\text{air}r) $$
It gives the count rate in the detector $\dot{N}$ (number of counts per second), from the activity of the source $A$, branching ratio of the radionuclide $n_\gamma$, efficiency of the detector $\varepsilon$, and attenuation coefficient for gamma particles in air $\mu_\text{air}$ for a given distance between the source and the detector $r$.
You have missed the efficiency of the detector mainly, and this is the tricky part. It describes how efficient the detector is at detecting the particles in a given geometry. Basically:
$$\text{efficiency of detector}=\frac{\text{Numb. of photons emitted}}{\text{Numb. of photons detected}}$$
Obtaining the efficiency of the detector is called "calibrating the efficiency of the detector" and only after you have performed this procedure, you can estimate the activity of the source. You can do this up to varying degrees of accuracy with a source of documented activity, depending on the accuracy of the documented activity of course, providing you have such source. Do not forget to take into account the decay during the time between the measurement and the documented date.
The efficiency and air attenuation are energy dependent, so they will be different for radionuclides emitting different energy gamma particles. Air attenuation coefficients for gamma particles can be looked up in NIST tables online.
Air attenuation can basically be neglected if dealing with very short distances $r<1\text{m}$.
For any further information, this topic is well covered in any radiation physics book (e.g. Radiation Detection by Knoll).