IMPORTRANGE is a useful spreadsheet function that allows you to select a range of values in spreadsheet A and import it to a range in spreadsheet B.
The syntax is:
The first parameter to IMPORTRANGE is the spreadsheet key. To find the spreadsheet key in the old Google Sheets, look at the URL in the browser address bar and select the long sequence of characters in the “key=” attribute. In the new Google Sheets, use the entire URL. You can either enclose spreadsheet_key in quotation marks, or instead use a reference to a cell containing the appropriate spreadsheet_key.
range_string has the format “[sheet_name!]range” (e.g. “Sheet1!B2:D12”), and specifies the range to be imported. The sheet_name component of range_string is optional, and if omitted IMPORTRANGE will import the quoted range from the first sheet.
Note that the first time IMPORTRANGE is used, the application will intervene:
The owner is essentially being asked to grant access to the source spreadsheet; hovering over the cell produces a dialog:
After this step has been completed, by clicking on the blue button, then subsequent requests will be allowed. Here’s the completed IMPORTRANGE: