I have two datasets that automatically download into Google Sheets from different Google Analytics accounts. They have the same columns, and I'm creating a separate Sheet that combines the data from both (one on top of the other).

Step 1: I have formulas that count the number of rows of data in each sheet
SheetA=9917 (cell S1)
SheetB=4826 (cell S2)
Step 2: I create a formula that concatenates the data together which will, when executed, append the two datasets together
Concatenate("{'SheetA'!A2:P",S1,";'SheetB'!A2:P",S2,"}")
This results in: {'SheetA'!A2:P9917;'SheetB'!A2:P4826}
The problem is that I can't get this to automatically execute. I've tried an indirect formula, but it just pulls the string without executing the formula. I suspect the array {} might be getting in the way of the indirect. I'd really like to automate it because the data that updates Sheets A and B automatically updates every day, but right now the only way I can get the above formula to execute is to manually copy and paste it after an =. I've tried adding the = to the concatenate and that doesn't work either.

Help?