Sample Spreadsheet: https://docs.google.com/spreadsheets/d/16p4M5UBODyBhmWFXYrA0FdLsA1FmwSmbrF12VUHlGaw/edit?usp=sharing
I have this formula which works great:
=ARRAYFORMULA(QUERY({Projects!A:C, (REGEXEXTRACT((RIGHT(Projects!C:C,LEN(Projects!C:C)-13)),"[\w]* [\w]*")), Projects!D:H},"SELECT Col1, Col4, Col7 WHERE LOWER(Col3) CONTAINS 'receive' AND LOWER(Col3) CONTAINS 'payment' AND Col9<>'Complete' AND Col9<>'N/A' ORDER BY Col7 ASC LIMIT 8 LABEL Col1 '', Col4 '', Col7 ''"))
I'm trying to show only the results where Projects!A:A (Col1) is within a range on another sheet.
Without the Array, typically I'd write it like this:
=QUERY(FILTER(Projects!A:C,MATCH(Projects!A:A,INDIRECT("'"&$D$2&"'!A:A"), 0)),"SELECT STATEMENT HERE")
When adding the FILTER(MATCH( into the first original working formula you get this:
=ARRAYFORMULA(QUERY({FILTER(Projects!A:C, MATCH(Projects!A:A,INDIRECT("'"&$D$2&"'!A:A"), 0)), (REGEXEXTRACT((RIGHT(Projects!C:C,LEN(Projects!C:C)-13)),"[\w]* [\w]*")), Projects!D:H},"SELECT Col1, Col4, Col7 WHERE LOWER(Col3) CONTAINS 'receive' AND LOWER(Col3) CONTAINS 'payment' AND Col9<>'Complete' AND Col9<>'N/A' ORDER BY Col7 ASC LIMIT 8 LABEL Col1 '', Col4 '', Col7 ''"))
The result is an error:
"Function ARRAY_ROW parameter 2 has mismatched row size. Expected: 2377. Actual: 6816."
The Projects tab is 6816 rows long, but I don't know what is 2377 rows long.
The interesting thing is that when I'm within the Formula bar, the schematic highlighting isn't working for parameter 2 of FILTER. See attached image.
How can I add filter the results of Col1 to only show if the results are within another tab's range?
Best Answer
You can try the following formula instead
The above is based on your existing formula. There are simpler solutions as well if interested.