ShareYourGroupShareYourGroupGoogle Sheets

Only in Sheets

IMPORTRANGE function in Google Sheets

IMPORTRANGE brings a range of cells from another Google Sheets file into this one, and keeps it up to date.

In Sheets, each spreadsheet is a separate file with its own web address. IMPORTRANGE is the bridge between files. A manager's summary file can pull each branch's figures from the branch's own file. When the source changes, the copy follows.

The examples above show no results, because they depend on a real second file.

Syntax

=IMPORTRANGE(spreadsheet_url, range_string)
ArgumentWhat it is
spreadsheet_urlThe web address of the other spreadsheet, in quotation marks, or a cell that holds it. The long key from the middle of the address works too.
range_stringThe sheet name and range, as text: "Sheet1!A1:F100". Without a sheet name, the first sheet is used.

Examples

How it works

Give the address of the source file and, as text, the tab and range you want. The data appears in the cells below and to the right of the formula.

Allowing access, once

The first time one file imports from another, the cell shows #REF!. Hover over it and a button appears asking you to allow access. Press it once. From then on, any IMPORTRANGE in this file may read that source file.

You can only allow access if you yourself are able to open the source file. If you cannot, ask its owner to share it with you.

Remember what this means: once access is allowed, anyone who can view your file can see the imported data, even if they have no access to the source. Do not import private data into a widely shared file.

Writing the range

The second argument is text, in quotation marks.

Keeping the address in a cell, as in the second example, makes the formula shorter and lets you point several formulas at a new source by changing one cell.

Only values come across

IMPORTRANGE brings values. Formulas, colours, number formats, column widths and notes stay behind. Dates may arrive as numbers until you format the cells.

Working on the imported data

Wrap IMPORTRANGE in another function to import only what you need.

Importing a narrow range and filtering at the source keeps both files quicker.

When it is slow or fails

Common mistakes

In Excel

Excel links workbooks differently: a formula can refer to another file directly, as in ='[Sales.xlsx]Sheet1'!A1. There is no IMPORTRANGE.

Related functions

The results on this page were worked out by us from the sample sheet; they were not produced by a script running Google Sheets. If Sheets shows you something different, please tell us.

This is an independent help site. It is not connected with or approved by Google. Google Sheets is a trademark of Google LLC, named here only to say which program a formula is for. The people and figures in the sample sheets are made up.