Inside The Web
    Facebook Twitter Instagram
    Inside The Web
    • Office
      • Excel
      • Ms Word
      • OneDrive
      • Google Docs
      • Google Sheets
      • Google Drive
    • Email
      • Gmail
      • Outlook
      • Emal Etiquette
    • Office Etiquette
    • Productivity
    Inside The Web
    Home»Office»Google Sheets»How to Use IMPORTRANGE in Google Sheets

    How to Use IMPORTRANGE in Google Sheets

    Asmi DhakalBy Asmi DhakalDecember 17, 2023 Google Sheets 4 Mins Read

    The IMPORTRANGE function is an exclusive function in Google Sheets to link data from different sheets. If you usually merge data between sheets, you may need to familiarize yourself with this function.

    IMPORTRANGE is dynamic in nature—every time you edit the source sheet, the change is immediately reflected on the linked data.

    Using this function, you can not only create links between multiple worksheets but also append data.

    Now, let’s first start with the arguments used in this function.

    IMPORTRANGE Function: Arguments

    =IMPORTRANGE(“spreadsheet_url”, “range_string”)
    • Spreadsheet_url: The Uniform Resource Locator (URL) of your source spreadsheet
    • Range_string: The sheet and range name containing the data you wish to source
    Note: You must enclose both of these arguments inside double quotes in a formula. If you miss entering this syntax, you will encounter the #N/A error.

    After entering the formula, you will first encounter the #REF error as your sheets aren’t currently connected.

    Allow access

    To fix this, select the cell with the formula and click Allow Access.

    Link Data When Workbook Contains Single Sheet

    If your workbook contains only one sheet, you don’t necessarily have to specify the sheet name. Simply referencing the range will do the trick.

    The following workbook contains only one sheet.

    Worksheet in GSheets

    We’ll be importing data from range C4:C13 from this sheet. In cell A4 of the destination sheet, I entered the following formula:

    =IMPORTRANGE("https://docs.google.com/spreadsheets/d/1N6TXj_X66OJit_4Ky_hriukJMiLoM-_nYFu-1lbBMcU/edit#gid=0","C4:C14")
    IMPORTRANGE from workbook with one sheet

    Link Data When Workbook Contains Multiple Sheets

    You must specify the sheet’s name if the source workbook contains multiple worksheets. If you skip this, IMPORTRANGE will import data from the first sheet in the workbook.

    The following workbook contains three sales sheets. However, I only want to import data from range A4:B10 in the third worksheet, “Week3_sales”.

    Workbook with three worksheets

    In my destination worksheet, I entered the following formula to make this extraction:

    =IMPORTRANGE("https://docs.google.com/spreadsheets/d/1N6TXj_X66OJit_4Ky_hriukJMiLoM-_nYFu-1lbBMcU/edit#gid=1216284927","Week3_Sales!A4:B10")
    IMPORTRANGE from workbook with three sheets

    Append Data from Multiple Worksheets

    You can also use the IMPORTRANGE function to stack data from multiple worksheets onto each other.

    This workbook contains two worksheets.

    Two worksheets GSheets

    On a new workbook, I want to stack data from Sheet2 on top of Sheet1.

    For this, I will be creating an array formula using the IMPORTRANGE function.

    Note: Use the same method to append worksheets in different workbooks.

    Here’s the formula I entered to make this arrangement:

    ={IMPORTRANGE("https://docs.google.com/spreadsheets/d/118L0nmqG0nDYifB95LCGFhDjkOKjb5hqyxAhtZC2Ay8/edit#gid=0","Sheet1!A3:F17");IMPORTRANGE("https://docs.google.com/spreadsheets/d/118L0nmqG0nDYifB95LCGFhDjkOKjb5hqyxAhtZC2Ay8/edit#gid=0","Sheet2!A4:F17")}
    Append Data Using IMPORTRANGE

    When you enclose a formula inside curly brackets, you’re commanding Google Sheets to treat it as an array formula. If you do not enter the curly brackets, it will return the #ERROR code.

    Use IMPORTRANGE Dynamically

    You can reference cells as arguments inside the IMPORTRANGE function. For instance, if cell A2 contains the sheet URL, I can simply reference the cell inside the spreadsheeet_urlsection of the IMPORTRANGE formula.

    Every time I change the values inside the referenced cells, IMPORTRANGEwill generate a different result, making the formula dynamic.

    We can further incorporate Data Validation in the referenced cell to create a drop-down list.

    Here’s how you can use the function dynamically in GSheets:

    1. Select an empty cell in your workbook.
    2. Click on Data > Data Validation.
      Select data validation
    3. From the sidebar, select Add Rule.
    4. Enter your URLs in the Option section. To add more options, click on Add another item.
    5. Select OK.
      Enter URL data validation
    6. Select Add Rule again.
      Add rule data validation
    7. Repeat this to create a drop-down list for the cell ranges.
      Data validation cell range
    8. Enter your formula into the cell in which you wish to import your data.
    =IMPORTRANGE(H4,I4)
    1. To change your data set, click on the drop-down and choose a URL. Specify the cell range accordingly.
      Data Validation with IMPORTRANGE

    Set Criteria Using Query in IMPORTRANGE

    If you want to set conditions while importing data, use the QUERY function with IMPORTRANGE.

    The QUERY function can be a bit complex as it uses a specific language. Refer to Google’s article on this language to better understand the syntax to set criteria.

    As an example, we have a data table with a list of students appearing for an exam. Unfortunately, only the students with a registration number are allowed to sit this exam.

    Source sheet

    We need to import the names of students who have a registration number using the IMPORTRANGE and QUERY function.

    On our destination sheet, here is how we construct a formula nesting QUERY to match this criterion:

    =QUERY(IMPORTRANGE("https://docs.google.com/spreadsheets/d/1yMCNRqp-hf8c0zuJjXg55RuZR2BYKL2L3BlseTJ1Q2Q/edit#gid=888095793","Sheet3!A1:B41"),"select Col2 where Col1 is not null",0)
    query and importrange function
    Asmi Dhakal

      Asmi is a content writer specializing in MS Office. She loves writing Excel-related content to assist other users to learn their way around the program. She started using Excel when she first entered the industry as a marketing intern. Soon, she realized that learning the often-overlooked spreadsheet program was no piece of cake. In her articles, she attempts to brief out complex topics to help beginner to intermediate-level Excel users. Asmi uses Excel for everything, including creating a grocery list to managing her personal finance. She’s a bit dramatic when it comes to the Flash Fill feature; so much so that could write a eulogy out of it. When she’s not working, you’ll find her learning a new recipe, or cleaning up her mess (out of the failed recipe).

      Related Posts

      Google Sheets By Jabin Manandhar

      9 Ways to Fix Google Sheets Not Working

      Google Sheets By Asmi Dhakal

      How to Delete Every Other Row in Google Sheets

      Google Sheets By Nisha Gurung

      How to Highlight Duplicates in Google Sheets

      Add A Comment
      Table of ContentsToggle Table of ContentToggle
      • IMPORTRANGE Function: Arguments
      • Link Data When Workbook Contains Single Sheet
      • Link Data When Workbook Contains Multiple Sheets
      • Append Data from Multiple Worksheets
      • Use IMPORTRANGE Dynamically
      • Set Criteria Using Query in IMPORTRANGE
      • Home
      • About Us
      • Privacy Policy
      © 2025 Inside The Web

      Type above and press Enter to search. Press Esc to cancel.