Skip to main content
8 of 8
deleted 37 characters in body; edited tags
pnuts
  • 17.8k
  • 5
  • 54
  • 103

How do I get data from one Google Spreadsheets "A" into Spreadsheets "B"?

How do I get data from one Google spreadsheet A into spreadsheet B so
when Spreadsheet A is modified, then Spreadsheet B also changes automatically?

A formula using QUERY() and IMPORTRANGE() functions was tried, but it didn't return the expected results. For example, I have two spreadsheets Documents DocA and DocB:

    A               B           C
1    uid            serial_no   ph
2   356307042189331 3123958     912345678900
3   356307046077540 3966305     923451245123
4   356307046092465 3966407     978458784578
5   356307046098678 3970932     971548745125

In DocB

    A               B
1   serial_no      uid
2   3123958
3   3284728
4   3284655

I am trying to get A2 from DocA into B2 in DocB with the following formula

=QUERY(
     ImportRange("[key]","Sheet1!A:C"),
     "Select Col1, Col2 where Col1='"&A2&"'",
     1
 )

I get uid serial_no in Cell B2 instead of the value in Cell A2 of DocA.