I'm trying to re-build COUNTIFS as a Google Scripts Custom Function and having trouble with one thing: how do I build a function that accepts an arbitrary number of arguments?
If you use COUNTIFS in google sheets, the inputs look like this:
=COUNTIFS(criteria_range1, criterion1, [criteria_range2, criterion2, ...])
My Google Script can be this:
function COUNTIFS(criteria_range1, criterion1){
// CountIFS code
}
...but how do I get the optional arguments in my function?