=QUERY('F/O OFF'!1:1000, select H, J where B='CIN'label H'', J'')Right now this formula works fine,  but i have to change the where B= for each row in the sheet.   I want to get it so where B= (The value in colA of the row the query is being inputted in)
How to refer to a cell's content from a query in Google Spreadsheets?
google spreadsheets
To replace a fixed string like CIN with the content of a cell, use concatenation &: =QUERY('F/O OFF'!$1:$1000, select H, J where B = '&A2&' label H'', J'')As written, this would work for the second row; you can extend the formula to other rows in the usual way, and the relative reference will be adjusted.