A general formula would be:
Tf*Vtot = Tr*Vr + Ta*Va
Tf = final temperature
Vtot = total volume of the tank
The product of the above is equal to the linear combination of the products of the original temperature and the remaining volume plus the temperature of the added times the added volume.
In the above equation,
Tr = temperature of the remaining water (should be the same as the temperature of the water in the tank before the water change)
Vr = volume remaining after the amount of the water change is taken out
Ta = temperature of the added water
Va = volume of the added water.
For the equation to work, be sure to keep all the units the same. I.e. all the volumes in liters, US gallons, or UK gallons. It doesn't matter which you use (or mL, or bushels, etc.) so long as all three at the same. Same for the temperatures -- they have to all the same (Fahrenheit, Celsius, Rankine, Kelvin, etc.).
Lastly, to be really particular, the heat capacity of water is not a constant with temperature. That is, it takes a little more energy to raise 1 liter of water from 25 to 26 degrees C than it does to raise 1 liter of water from 15 to 16 degrees C. However, there really isn't a need to worry about this because unless you are measuring the volumes really exactly, or the temperatures really exactly, the extra accuracy of the weakly temperature dependent heat capacity is lost in the errors of the other measurements. And, the dependence on temperature is weak -- assuming it is constant over all the ranges of temperature of interest to fishkeepers is a very acceptable assumption.
---------
In the question at hand:
Tf=23 or 29 (didn't state specifically warmer or colder)
Vf=300
Ta = to be solved for
Va=100
Tr=26
Vr=200
23*300 = Ta*100 + 26*200 move the 26*200 to the left hand side, and divide it all by 100:
23*3 - 26*2 = Ta = 17 exactly as KK posted.
I'll let you find what Ta would be if Tf = 29 as if you were adding water that was warmer than the tank temp)