How can I calculate how long an amount of money will last if I spend x dollars per month, at the same time as the pot of money is attracting interest at y percent? Is thare a formula?

Thanks

This is the same as the formula for borrowing money and repaying a monthly amount.

Let
P=principal
n=number of months it will last
y=interest rate, compounded monthly at y/12, (use 0.10 for 10% per annum)
x=monthly spending
then
p(1+y/12)^n=x((1+y/12)^n-1)/(y/12)
Unfortunately, to solve for n, you need to solve it by trial and error or Newton's method.
There exist compound interest calculators, such as:
http://www.thecalculatorsite.com/finance/calculators/compoundinterestcalculator.php#results