I am confused why you are using "INDEX()=1" and "INDEX()=2" as your arguments. This would mean that the variables a and b in the code are vectors of true/false values.
From the question, my guess is that you would like a to be the vector of Number of Students from School A and b the vector of students from school B, so that with the example data a = c(100, 30, 200) and b=(200,25,400). Is this correct?
If so, then I would suggest creating new fields to return counts for school A and school B. I've attached a workbook that uses your example data to return a p.value of .005762.
If this isn't correct, could you provide an example of the code you are running in R for comparison?
Example chi.squared.twbx 17.8 KB