Yes, there's a formula, but it's kind of complicated. The formula is:
n is the number of months (assuming monthly payments)
r is the monthly interest rate, expressed as a decimal, e.g. 2% is .02
P is the initial loan amount
m is the monthly payment
b is the balance after n months
Oh, and I'm using "computer notation" here: * is multiplication, / is division, and ^ means raise to the power.
The bank may also add interest from the date the loan was made until the first payment, which complicates the formula a little more.
I probably should write this formula down because every time I need it I ever to figure it out again. In practice I usually find it simpler to set up a spreadsheet. :-)
Oh, I should make clear that the interest rate r here is the MONTHLY interest rate, not considering compounding. So if you have an annual interest rate, divide by 12.
I ran your example through this formula and came up with $9567.86, which if we round off to the nearest dollar matches the number you expected.