Thanks, Jim! It worked!
Slightly rephrased, for those who need to hear things different ways, here's how you have a column that counts the number of selected rows:
- Make a new column with formula: N Rows( Current Data Table() << get selected rows )
- Note, this formula won't automatically update when the selection changes, which is why we do step #2...
- Make a new script (in red triangle menu in top left of data table) with:
Names Default To Here( 1 );
dt = Current Data Table();
f = Function( {a},
dt << rerun formulas()
);
rs = dt << make row state handler( f );
... which basically says, whenever the row states change, run function "f", which takes "a" as an argument (which gets ignored), and tells dt (the current data table) to re-run its formulas. Then run this script once.
Jim's answer shows how to extend this to only count selected rows that meet some other criteria, which was part of the original question.
Thx again!