That is the formula but in the context of Routine 3, problem 7, you don't need to use it.
The t in your formula is the number of years which could be a decimal. In this problem, we don't know the t.
Instead, if r/n is the monthly interest rate (n = 12) where r is the annual rate, then each month the interest is computed as balance times monthly interest rate and then that is added to the balance.
Think about how you could loop updating the balance each time through the loop so that you could count up the number of months you update the balance until you meet or exceed the goal.