scopedif function

Test for all, any or none