Home > database >  Google Sheets Query Function for multiple similar rows
Google Sheets Query Function for multiple similar rows

Time:01-05

I have a table for which I have the following data, as example:

=QUERY(Database!A:L;"SELECT A, C, L WHERE L=TRUE";1)

table

The thing is I want to return the data ONLY if the column B value (Tag column) is similar to the next one.

So, in the example above it should return only the following lines:
enter image description here

Can anybody help me?

CodePudding user response:

you can try:

=QUERY({A:L,{"ZZ";MAKEARRAY(ROWS(C2:C),1,LAMBDA(r,c,IF(INDEX(C2:C,r)=OFFSET(INDEX(C2:C,r),-1,0),1,0)))}},"SELECT Col1,Col3,Col12 WHERE Col3!='' AND Col13=1",0)

-

enter image description here

CodePudding user response:

You may try the following formula-

=LAMBDA(rng,FILTER(rng,INDEX(BYROW(rng,LAMBDA(x,COUNTIFS(A2:A&B2:B&C2:C,JOIN("",x)))))>1))(A2:INDEX(C2:C,COUNTA(A2:A)))

enter image description here

  • Related