HomeGoogle DocsSpreadsheetImportrange Named Ranges in Google Sheets

Importrange Named Ranges in Google Sheets

Published on

The Importrange function in Sheets works well with Named Ranges. See how to Importrange Named Ranges in Google Sheets.

The Importrange function is useful to import data in one workbook to another. I mean it’s the function to use to make data transfer between two Google Sheets files.

IMPORTRANGE(spreadsheet_url, range_string)

The Importrange function requires the URL of the source sheet and range to import (range_string). You can replace the range_string in Importrange with Named Ranges.

One more thing! If you grab the URL of someone else’s Google Sheets and apply it in Importrange, it won’t work. You need permission to use the URLs in Importrange.

If you have the permission then you can “Allow Access” in the cell that contains the formula which normally returns a #REF! error in its first use.

How to Importrange Named Ranges in Google Sheets

I am talking about two workbooks, I mean two Google Sheets files, here.

File A: Contains Two Tabs named as “Div A” and “Div B”

I have the following contents in the Tab “Div A” in the file named as “File A”. Assume this as the attendance of students in a class in Division A.

attendance-div-a - sample data

In Tab 2 which is “Div B” in the same file, I have similar data. It’s not relevant here. So I am not sharing the screenshot.

File B: A Blank Workbook Contains the Tab “Sheet1”

To import the data in this workbook (“File B”) from another workbook (“File A”) we can use the Importrange function as below.

=importrange("https://docs.google.com/spreadsheets/d/1fuzAP1Yg2NRwxumDkDicrjT5nmUNyE-JtrwObXdZqeg/edit#gid=0","Div A!A1:K7")

I have this formula in cell A1 in “Sheet1” (“File B”). This formula imports the data in the range A1:K7 that available in “File A”.

Now let me show you how to Importrange Named Ranges in Google Sheets.

Define Named Ranges to Use in Importrange in Google Sheets

Go to “File A” (tab “Div A”) and name the range A1:K7. To do that highlight to select the range A1:K7 and right click and choose “Define named range”.

define named range for importrange

On the sidebar panel, replace “NamedRange1” with “Div_A”. Similarly, create a named range for the range in the tab “Div B” as “Div_B”.

two named ranges to use in Importrange

Importrange + Named Range Combination Formula

Once you have defined two named ranges as above, go to “File B”. Open a new tab “Sheet2” and in cell A1, enter this formula.

=importrange("https://docs.google.com/spreadsheets/d/1fuzAP1Yg2NRwxumDkDicrjT5nmUNyE-JtrwObXdZqeg/edit#gid=0","Div_A")

In this formula, the range_string is replaced by the named ranges.

What is the benefit of using Named Ranges in Importrange in Google Sheets?

Advantages of Using Named Ranges in Google Sheets Importrange Function

To understand the benefit of using named ranges in Importrange do as follows.

Benefit of Using Named Range in Importrange 1

Got the workbook “File A”. In “Div A” tab, select the column A. Then right click and choose “insert 1 right”.

In “File B”, check the formula outputs in “Sheet1” (formula without named ranges) and “Sheet2” (formula with named ranges). You can see that in Sheet1, the imported data missed one column at the last.

That means Named Ranges brings dynamism to the ranges in Importrange.

Benefit of Using Named Range in Importrange 2

You can refer to a Data Validation drop_down menu, that contains the Named Ranges, in Importrange.

I didn’t get. Can you explain?

Yes! Create one more Sheet (“Sheet3”) in “File B”. Right click on cell A1 and choose “Data validation”.

Choose “List of items” as Criteria and enter the name of Named Ranges as comma separated values in the given field as below.

Div_A,Div_B

In Cell B1 enter this formula.

=importrange("https://docs.google.com/spreadsheets/d/1fuzAP1Yg2NRwxumDkDicrjT5nmUNyE-JtrwObXdZqeg/edit#gid=0",A1)
how to Importrange Named Ranges in Google Sheets

Hope you find this tutorial, i.e., how to Importrange Named Ranges in Google Sheets, worthy. Enjoy!

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Google Sheets Bar and Column Chart with Target Coloring

To color each data point in the column or bar chart according to the...

Analyzing Column A Between Non-Adjacent Values in Column B: Google Sheets

This tutorial addresses a common scenario encountered in Google Sheets: how to sum, average,...

Excel Word Count: Beyond SUBSTITUTE

You might want to count the number of words in a cell in Excel...

Sum by Quarter in Excel: New and Efficient Techniques

Knowing how to sum by quarter is crucial in Excel because quarterly reporting has...

More like this

Google Sheets Bar and Column Chart with Target Coloring

To color each data point in the column or bar chart according to the...

Analyzing Column A Between Non-Adjacent Values in Column B: Google Sheets

This tutorial addresses a common scenario encountered in Google Sheets: how to sum, average,...

Count Distinct Values in Google Sheets Pivot Table

There is a built-in function for counting distinct values in a Google Sheets Pivot...

6 COMMENTS

  1. My data range isn’t large. Just b2:m9 and I keep getting a #Ref error. Not sure what I am doing wrong. Allowed the permissions and everything.

    • Hi, Stephanie,

      Copy the formula and insert it in a new tab. See whether it’s working. If this doesn’t solve the problem, please check what the tooltip (hover your mouse over the error value) says.

        • Hi, Melissa,

          That means the Sheet belongs to someone else.

          Please try the below steps.

          1. Copy the URL of the Sheet from the importrange formula.
          2. Paste it in the browser address bar and hit enter.
          3. Click on “Request access.”

  2. Hi

    What’s the limit range to select?

    I have thousands of rows and columns till ‘AQ’, After trying the above formula facing the “Result too large” error

    Is there any alternate, thanks in Advance.

    • Hi, Bindu,

      Regarding the limitation, Google Sheets Documentation on Importrange says;

      If the data you are trying to import is too large, you may get an error.

      So I don’t know exactly the limit of rows and columns in Importrange.

      Anyway, you can import the data part by part using multiple Importranges and join them like;

      ={importrange_output_part_1;importrange_output_part2}

      Hope this helps?

      Best,

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.