How to Use IMPORTRANGE Function in Google Sheets?
When working with Google Sheets, we can have multiple tables, multiple sheets. We may need to use the same data on different pages. You may think of getting data with copy-paste. But this would not be a tiring and continuous practice. We can easily make this application with IMPORTRANGE. If you have worked with VLOOKUP before, you must have done similar work. If you want to review, you can find the detailed article here🡪 “How to use VLOOKUP function in Google Sheets”
What is the syntax for the IMPORTRANGE function?
The function may sound long, but it has a fairly easy syntax. It looks long because it contains the URL. Let me explain the syntax with the example below.
=IMPORTRANGE("https://docs.google.com/spreadsheets/d/1RlFw25ePjhvRYMjVuXjkXChjorpQLY3Dr6ZsfkfaUfo/edit#gid=0","Sheet1!A1:E15")
=IMPORTRANGE(“URL”,”Page name!cell range”)
Let's fill the function in order.
Function
=IMPORTRAGANGE(
URL
https://docs.google.com/spreadsheets/d/1RlFw25ePjhvRYMjVuXjkXChjorpQLY3Dr6ZsfkfaUfo/edit#gid=0” 🡪The page URL from which we want to get the data. Don't forget to write it in (").
Come to the worksheet where we want to get data for the URL, Copy the location indicated in the screenshot above. Paste the data into the function on the page we want to move
Page Name
The page name is written under the page from which we want to retrieve the data. We write the page name here, starting with (“ ). The sheet name in my example is the sheet name given by the table. Sheet1 for changing it. If you want, you can change it by right-clicking here and clicking 'rename'
Don't forget to put (!) after the sheet name.-->”Sheet1!
Cell Range
Now I can enter the cell range from which we want to get data. The sheet I want to get data from is "Sheet1". I come to this page and I want to get the whole table. For this, I write A1:E15 in my function.
If I just want to get column A1 I have to write A1:A. It has the advantage of being like this. If I write it like this, every cell I add to column A will also be on my added. If I specify certain ranges (like A1:A15) and add a new cell to the sheet I want to get data from, it will not be added to my new worksheet. Don't forget to put(“) after adding the cell range.
After writing our cell range, we can close the parenthesis and finish the function. And a warning will come as follows.
We must not make sure that we have access to the page. If we don't have access, the data will not arrive.
You can find detailed information about permissions here ”How to lock cells in Google Sheets?”
After giving permission, we moved our table as we wanted.