Reputation: 45
I've hesitated to ask since this seems so simple of a formula but I've been having difficulty getting it to function. Data is imported from a different workbook to sheet1 and a different set of data is imported to sheet2. Now, I am attempting to compile data by matching column E of sheet1 with column D of sheet2 (Both columns contain names) and inputting it into sheet3 of the same workbook. Pending a match, I'm attempting to display only the pertinent data that I need for records (Columns A(date), H(number), F(number), S(text)).
=QUERY(Sheet1!A:S,"select A, H, F, S where E matches '"&Sheet2!D:D&"'",1)
This returns the heading of the requested columns, but does not display any matching information (which from a manual count there should be 5 rows displayed). Ive fiddled with different formulas to include Indexes and Filters but I cant seem to get the format down to get close to replicating what I currently have. I'm assuming the issue lies in [where E matches '"&Sheet!2D:D&"'"]. Is this comparing the length of the two columns rather than the values located in the columns? Do I need to index the columns first?
Upvotes: 3
Views: 1903
Reputation: 1
try:
=QUERY(Sheet1!A:S,
"select A,H,F,S
where E matches '"&TEXTJOIN("|", 1, Sheet2!D:D)&"'", 1)
Upvotes: 2