Calculating resistance given capacitance and charge over time
The voltage of a capacitor initially at voltage \$V_0\$ with capacitance \$C\$ discharging through a resistance \$R\$ at time \$t\$ is given by

\$ V_t = V_0 e^{-t/(RC)} \$

(source at hyperphysics)

\$V_t\$ will approach \$0V\$ but never fully discharge, but we can still solve for \$R\$, which will allow you to calculate the resistance by measuring the capacitor voltage some time \$t\$ after starting to discharge it:

\$ V_t / V_0 = e^{-t/(RC)} \$

\$ \log_e(V_t/V_0) = \dfrac{-t}{RC} \$

\$ R = \dfrac{-t}{C \cdot \log_e(V_t/V_0)} \$

Which is almost what you had, except for the \$(1-...)\$ bit, which is for charging a capacitor.

See also these from hyperphysics:


charging a capacitior
capacitor discharging