Vel Green
Vel Green

Reputation: 67

Range formula in Google Sheets

I need to give as an argument to the function COUNTIFS the function that looks like in Javasctipt

   function range (a) {
      if(a>=6 && a<=12) {
      return true;
    }
      return false;
   }

I've tried to use something like this in the formula, but it hasn't worked.

AND(MIN(6);MAX(12)) 

The full formula looks like this

=COUNTIFS('Data_list'!G:G; $A2; 'Data_list'!L:L; $B2;'Data_list'!H:H; AND(MIN(6);MAX(12)))

Any ideas on how to solve this issue?

Upvotes: 0

Views: 46

Answers (2)

player0
player0

Reputation: 1

for example:

=ARRAYFORMULA(SUM(--REGEXMATCH(FILTER(Data_list!H:H&"", 
 Data_list!G:G=A2, Data_list!L:L=B2), 
 "^"&TEXTJOIN("$|^", 1, ROW(A6:A12))&"$")))

0

Upvotes: 2

BigBen
BigBen

Reputation: 50162

You can use operators in COUNTIFS, as demonstrated in the docs:

=COUNTIFS('Data_list'!G:G; $A2; 'Data_list'!L:L; $B2;'Data_list'!H:H; ">=6";'Data_list'!H:H; "<=12")

Upvotes: 1

Related Questions