A few things may be causing the difference in values for the 2 injections. Firstly, check that the result at injection 2 is the correct one. Compare it with a manual calculation or using Excel. Also check that you only have the label TS used ONCE in the sample set, and not repeated for any previous sample. If thats correct, you just need to eliminate the result at injection 1. The first part of the formula is an intersample CF which needs both sections of the argument to calculate correctly, so at Injection 1 of the sample, there is no value yet for Injection 2 so essentially the calculation at injection 1 is: retention time- ZERO/Average RT. At Injection 2, all arguments are present, so Empower calculates retention time injection 1- retention time injection 2/Average retention time over 2 injections. The average value will be correct for both lines as thats an intersample summary CF so is populated correctly at all relevant lines. Summarize Custom Fields needs to be the last line of the sample set and needs to be set to "Normal" in the Processing column of the sample set.
Edit the formula to tick the "All or Nothing" option- this option will only populate the correct result on Injection 2 of the result when processed. All arguments are present at Injection 2. If this doesnt work, you can add a Bool condition to the end of the formula so that the result will only populate at Injection 2 of the sample labelled as TS and a blank value for every other result. For this option make sure All or Nothing is ticked. Edit the formula to read:
(EQ(Label,"TS")&EQ(Injection,2))*ABS((TS.1.(Retention Time)-TS.2.(Retention Time)))/TS.%..AVE(Retention Time)+(NEQ(Label,"TS")|NEQ(Injection,2))*-1*50000
Finally, occasionally CFs dont work right as they need to be named in alphabetical order so the field you are looking to measure is called Retention Time so for the CF you created, make sure the name of it starts with a letter GREATER than R so for example you could call it Sample_RT_Diff or something like that, as long as it starts with a Capital S. Then reprocess your sample set and you should get the correct results.
I hope this helps.