Forgive me if I explain too much including what you already know, but it is amazing how often people get confused about simple commonsense ideas when they are expressed in the "jargon" of maths.
Let E be the amount in Ellie's account and T the amount in Tanya's account after w weeks. At the risk of stating the obvious, the amounts E, T and w can change, and so we call them variables, and when we make statements about the amount remaining in an account being equal to a starting amount minus a certain amount per week multiplied by the number of weeks, this is called an equation.
E = 500 - 15w a)
T = 200 +12w b)
Subtract b from a. Result is the amount by which Ellie's account exceeds Tanya's account after w weeks
E - T = 300 - 27w
We can read this to say that the difference between the amounts in their accounts starts off as 300 and the difference reduces by 27 each week. If we now put in some particular value for the number of weeks w, we have an answer for the amount by which Ellie's account exceeds Tanya's account after that many weeks. We want to know what the situation is after w = 13 weeks.
E - T = 300 - 27 x13 = 300 -351 = -51
Do not get discouraged by the minus in the answer. It is correct. It just says the amount by which Ellie's account exceeds Tanya's account is -51 This is the same as saying the amount by which Tanya's account exceeds Ellie's account is +51
[More explanation: It is like an overdraft. If I have nothing in my bank account and the bank allows me to draw out £100 then what I have in my hand is plus 100 pounds but what I have in my bank account is minus £100. What has happened in your example is that Tanya has saved so much and Ellie has spent so much that Tanya now has more than Ellie in her account, 51 more. The minus sign came about because of our original insistence in expressing the result in terms of the amount Ellie's account exceeded Tanya's. If instead we had subtracted a from b, we would have got T - E = 27w - 300 = 351 - 300 = +51 (when we put w = 13 in the equation) ]
I hope that helped,
Regards - Ian