how to count how long of $5000 at 7% interest compounded for the investment to increase to 10000?

it will be awesome if you can put the way

Use the maximum compounding frequency which is daily. This will minimize the time required to reach $10,000.

P = Po(1+r)^n.

P = $10,000.
Po = $5,000 = Initial deposit.
r = (7%/360) / 100%=0.0001944.= Monthly % rate expressed as a decimal.
n = The # of compounding periods.

5000(1.0001944)^n = 10000
Divide both sides by 5000:
(1.0001944)^n = 2
Take log of both sides:
n*Log(1.0001944) = Log2
n = Log2 / Log(1.0001944) = 3565 Compounding periods.

T = 3565comp. * iyr/360Comp = 9.9 yrs.