Skip to main content
added 143 characters in body
Source Link
player0
  • 131.3k
  • 14
  • 91
  • 149

try:

=ARRAYFORMULA(IFNA(VLOOKUP(E2:E&"♥"&F2:F; REGEXREPLACE(TRIM(SPLIT(FLATTEN(QUERY(TRANSPOSE(QUERY(QUERY(TRIM(SPLIT( FLATTEN(IF(IFERROR(SPLIT(USERS!B2:B; ","))="";; SPLIT(USERS!B2:B; ",")&"♥"&USERS!C2:C&"♠♦"&USERS!A2:A&",♦"&USERS!A2:A)); "♦")); "select Col1,max(Col2) where Col2 is not null group by Col1 pivot Col3"); "offset 1"; 0));;9^9)); "♠")); ",$"; ); 2; 0))) 

enter image description here


update:

=QUERY=ARRAYFORMULA(QUERY({USERS!A:C, TRIM(FLATTEN(QUERY(TRANSPOSE( IF(IFERROR(SPLIT(USERS!B:B, ","))="",, SPLIT(USERS!B:B, ",")&"♥"&USERS!C:C)),,9^9)))}, "where"select Col1,Col2,Col3 where Col4 matches '.*"&TEXTJOIN(".*|.*", 1,   IF(LOCATIONS!A2:A)&".*' and Col3 matches '"& TEXTJOIN("|"A="", 1, LOCATIONS!A2:A&"♥"&LOCATIONS!B2:B)&"'")&".*'", 1)) 

enter image description hereenter image description here

try:

=ARRAYFORMULA(IFNA(VLOOKUP(E2:E&"♥"&F2:F; REGEXREPLACE(TRIM(SPLIT(FLATTEN(QUERY(TRANSPOSE(QUERY(QUERY(TRIM(SPLIT( FLATTEN(IF(IFERROR(SPLIT(USERS!B2:B; ","))="";; SPLIT(USERS!B2:B; ",")&"♥"&USERS!C2:C&"♠♦"&USERS!A2:A&",♦"&USERS!A2:A)); "♦")); "select Col1,max(Col2) where Col2 is not null group by Col1 pivot Col3"); "offset 1"; 0));;9^9)); "♠")); ",$"; ); 2; 0))) 

enter image description here


update:

=QUERY({USERS!A:C}, "where Col2 matches '.*"&TEXTJOIN(".*|.*", 1, LOCATIONS!A2:A)&".*' and Col3 matches '"& TEXTJOIN("|", 1, LOCATIONS!B2:B)&"'", 1) 

enter image description here

try:

=ARRAYFORMULA(IFNA(VLOOKUP(E2:E&"♥"&F2:F; REGEXREPLACE(TRIM(SPLIT(FLATTEN(QUERY(TRANSPOSE(QUERY(QUERY(TRIM(SPLIT( FLATTEN(IF(IFERROR(SPLIT(USERS!B2:B; ","))="";; SPLIT(USERS!B2:B; ",")&"♥"&USERS!C2:C&"♠♦"&USERS!A2:A&",♦"&USERS!A2:A)); "♦")); "select Col1,max(Col2) where Col2 is not null group by Col1 pivot Col3"); "offset 1"; 0));;9^9)); "♠")); ",$"; ); 2; 0))) 

enter image description here


update:

=ARRAYFORMULA(QUERY({USERS!A:C, TRIM(FLATTEN(QUERY(TRANSPOSE( IF(IFERROR(SPLIT(USERS!B:B, ","))="",, SPLIT(USERS!B:B, ",")&"♥"&USERS!C:C)),,9^9)))}, "select Col1,Col2,Col3 where Col4 matches '.*"&TEXTJOIN(".*|.*", 1,   IF(LOCATIONS!A2:A="",,LOCATIONS!A2:A&"♥"&LOCATIONS!B2:B))&".*'", 1)) 

enter image description here

added 296 characters in body
Source Link
player0
  • 131.3k
  • 14
  • 91
  • 149

try:

=ARRAYFORMULA(IFNA(VLOOKUP(E2:E&"♥"&F2:F; REGEXREPLACE(TRIM(SPLIT(FLATTEN(QUERY(TRANSPOSE(QUERY(QUERY(TRIM(SPLIT( FLATTEN(IF(IFERROR(SPLIT(USERS!B2:B; ","))="";; SPLIT(USERS!B2:B; ",")&"♥"&USERS!C2:C&"♠♦"&USERS!A2:A&",♦"&USERS!A2:A)); "♦")); "select Col1,max(Col2) where Col2 is not null group by Col1 pivot Col3"); "offset 1"; 0));;9^9)); "♠")); ",$"; ); 2; 0))) 

enter image description here


update:

=QUERY({USERS!A:C}, "where Col2 matches '.*"&TEXTJOIN(".*|.*", 1, LOCATIONS!A2:A)&".*' and Col3 matches '"& TEXTJOIN("|", 1, LOCATIONS!B2:B)&"'", 1) 

enter image description here

try:

=ARRAYFORMULA(IFNA(VLOOKUP(E2:E&"♥"&F2:F; REGEXREPLACE(TRIM(SPLIT(FLATTEN(QUERY(TRANSPOSE(QUERY(QUERY(TRIM(SPLIT( FLATTEN(IF(IFERROR(SPLIT(USERS!B2:B; ","))="";; SPLIT(USERS!B2:B; ",")&"♥"&USERS!C2:C&"♠♦"&USERS!A2:A&",♦"&USERS!A2:A)); "♦")); "select Col1,max(Col2) where Col2 is not null group by Col1 pivot Col3"); "offset 1"; 0));;9^9)); "♠")); ",$"; ); 2; 0))) 

enter image description here

try:

=ARRAYFORMULA(IFNA(VLOOKUP(E2:E&"♥"&F2:F; REGEXREPLACE(TRIM(SPLIT(FLATTEN(QUERY(TRANSPOSE(QUERY(QUERY(TRIM(SPLIT( FLATTEN(IF(IFERROR(SPLIT(USERS!B2:B; ","))="";; SPLIT(USERS!B2:B; ",")&"♥"&USERS!C2:C&"♠♦"&USERS!A2:A&",♦"&USERS!A2:A)); "♦")); "select Col1,max(Col2) where Col2 is not null group by Col1 pivot Col3"); "offset 1"; 0));;9^9)); "♠")); ",$"; ); 2; 0))) 

enter image description here


update:

=QUERY({USERS!A:C}, "where Col2 matches '.*"&TEXTJOIN(".*|.*", 1, LOCATIONS!A2:A)&".*' and Col3 matches '"& TEXTJOIN("|", 1, LOCATIONS!B2:B)&"'", 1) 

enter image description here

Source Link
player0
  • 131.3k
  • 14
  • 91
  • 149

try:

=ARRAYFORMULA(IFNA(VLOOKUP(E2:E&"♥"&F2:F; REGEXREPLACE(TRIM(SPLIT(FLATTEN(QUERY(TRANSPOSE(QUERY(QUERY(TRIM(SPLIT( FLATTEN(IF(IFERROR(SPLIT(USERS!B2:B; ","))="";; SPLIT(USERS!B2:B; ",")&"♥"&USERS!C2:C&"♠♦"&USERS!A2:A&",♦"&USERS!A2:A)); "♦")); "select Col1,max(Col2) where Col2 is not null group by Col1 pivot Col3"); "offset 1"; 0));;9^9)); "♠")); ",$"; ); 2; 0))) 

enter image description here