Ah......that requirement was not stated in the original question.
However, the code to do what you want is repetitive, but not difficult.
names default to here(1);
dt=current data table();
colNames = dt << get column names(string);
sumList = "";
if(contains(colNames,"TA008"),
sumList = ":TA008";
);
For(i=2900, i<=2950, i++,
If( contains(colNames,"SA" || char(i)),
if( sumList != "", sumList = sumList || ",");
sumList = sumList || ":SA" || char(i);
)
);
For(i=3400, i<=3500, i++,
If( contains(colNames,"SA" || char(i)),
if( sumList != "", sumList = sumList || ",");
sumList = sumList || ":SA" || char(i);
)
);
if(contains(colNames,"TA099"),
if( sumList != "", sumList = sumList || ",");
sumList = sumList || ":TA099";
);
Eval(
Parse(
"dt << new column(\!"Sums\!",formula(sum( " || sumList ||
" )));"
)
);
Jim