Google-sheets – How to index and locate information on one google sheet file and import it to another file in one formula

google sheets

Google Sheets:
I have two google files. Lets call them "Data" and "Sales"

I need a formula in "Sales" cell that will search a column in "Data" by matching a cell value in "Sales" to a cell value in "Data".

I am familiar with importRange, index and vlookup formulas but am stuck.

Best Answer

example of such combination would be:

=ARRAY_CONSTRAIN(ARRAYFORMULA(IF(LEN(IMPORTRANGE("ID"; "Sales!A2:A")); 
 VLOOKUP(IMPORTRANGE("ID"; "Sales!A2:A"); IMPORTRANGE("ID"; "Data!A2:B"); 2; 0); )); 1; 1)