Need to connect data between two different Google Sheets files? Whether you’re building dashboards, pulling reports from other teams, or organizing a multi-sheet workflow, Google Sheets offers several ways to link across files. From simple formulas like IMPORTRANGE to clickable hyperlinks and even automation with Apps Script, you can easily bring data together or navigate between files.
In this article, we’ll walk you through three effective ways to link one Google Sheets file to another, complete with use cases, formulas, and tips to avoid common pitfalls.
Steps to link data between Google Sheets files using the IMPORTRANGE function:
➤ Use the source dataset in cells A1:D11, with columns for Product ID, Product Name, Stock Level, and Warehouse.
➤ Copy the URL of the source spreadsheet, e.g.,
https://docs.google.com/spreadsheets/d/abcd1234xyz5678/edit
➤ In the destination file, enter this formula in cell A1:
=IMPORTRANGE(“https://docs.google.com/spreadsheets/d/abcd1234xyz5678/edit”, “Sheet1!A1:D11”)
➤ Press Enter and click “Allow access” to enable the link. The imported data will now sync automatically.
Link Data Between Google Sheets Files Using IMPORTRANGE
The IMPORTRANGE function lets you connect two separate Google Sheets files and pull data from one into another. It works by referencing the source file’s URL and range, making it easy to sync tables, cells, or entire sheets dynamically. This is ideal for building dashboards or reports that stay updated when the original file changes.
These are the datasets we will be using for these methods:
Product Inventory (Source Sheet)
Inventory Dashboard (Destination Sheet)
Steps:
➤ In the source file, the dataset is in cells A1:D11, with columns for Product ID, Product Name, Stock Level, and Warehouse.
➤ To link this data into the target file, copy the URL of the source sheet, for example:
https://docs.google.com/spreadsheets/d/abcd1234xyz5678/edit#gid=0
➤ In the destination file, enter this formula in cell A1:
=IMPORTRANGE(“https://docs.google.com/spreadsheets/d/abcd1234xyz5678/edit”, “Sheet1!A1:D11”)
➧ "Sheet1!A1:D11": Refers to the range to pull from, adjust the sheet name if needed.
➧ IMPORTRANGE: Retrieves the specified range from the other file.
➤ On first use, Google Sheets will ask for permission. Click “Allow access” to establish the connection.
➤ The linked data will now show up in your target file and automatically update whenever changes are made in the source.
Create Clickable Links to External Files Or Ranges Using HYPERLINK
The HYPERLINK function in Google Sheets allows you to create clickable text or buttons that open another spreadsheet, sheet, or even a specific cell range. While it doesn’t import data like IMPORTRANGE, it’s perfect for quick navigation between related files.
Steps:
➤ In your target file Inventory Dashboard, you want to add a link in cell A1 that opens the source sheet.
➤ Enter this formula in cell A1:
=HYPERLINK(“https://docs.google.com/spreadsheets/d/abcd1234xyz5678/edit”, “Open Product Inventory”)
➧ "Open Product Inventory": The anchor text users will click.
➤ Press Enter.
➤ You can link to a specific sheet or range by modifying the URL. For example:
To open cell B5 of Sheet2:
=HYPERLINK(“https://docs.google.com/spreadsheets/d/abcd1234xyz5678/edit#gid=123456789&range=B5”, “Go to Product Inventory B5”)
➤ Press Enter.
➤ This method is ideal when you want to reference files without displaying data, but still provide
Automate Cross-File Linking with Apps Script
When you need more dynamic control over how links are generated, like building a table of clickable links based on a list of file IDs or sheet names, Google Apps Script offers a powerful solution. This method is especially useful for teams managing multiple Sheets where manual linking is impractical.
Steps:
➤ In your Inventory Dashboard file, go to Extensions >> Apps Script.
➤ Delete any existing code and paste the following script:
function insertSheetLinks() {
const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
const fileIds = sheet.getRange("A2:A").getValues(); // Column A has the list of file IDs
const displayNames = sheet.getRange("B2:B").getValues(); // Column B has display names
for (let i = 0; i < fileIds.length; i++) {
if (fileIds[i][0]) {
const link = `https://docs.google.com/spreadsheets/d/${fileIds[i][0]}/edit`;
sheet.getRange(i + 2, 3).setFormula(`=HYPERLINK("${link}", "${displayNames[i][0]}")`);
}
}
}
➤ Save the script by clicking on the floppy disk icon.
➤ Get the sheet ID from your source sheet. It is between the d/ part and the /edit part of your URL.
➤ Now, enter the Sheet ID in cell A2 of the destination sheet, and enter the Display Name you want to assign to the hyperlink in cell B2.
➤ Return to Apps Script and click the Run button.
Column C will contain clickable links titled “Product Inventory”.
➤ This method is perfect for automating hyperlink creation at scale, especially in administrative dashboards or master tracking sheets.
Frequently Asked Questions
How do I link data from one Google Sheets file to another?
Use the IMPORTRANGE function to dynamically pull in data from another spreadsheet. Just provide the source file’s URL (or ID) and the range you want to import.
Can I create a clickable link to open another Google Sheets file?
Yes, you can use the HYPERLINK function in a cell like this:
=HYPERLINK(“https://docs.google.com/spreadsheets/d/FILE_ID/edit”, “Open File”)
What if I want to automate link creation for multiple files?
You can write a Google Apps Script that loops through a list of file IDs and display names to generate clickable hyperlinks in your sheet.
Do I need permission to access a linked file with IMPORTRANGE?
Yes. The first time you use IMPORTRANGE, Google Sheets will prompt you to “Allow access” to the source file. You need view permission at minimum.
What’s the difference between HYPERLINK and IMPORTRANGE?
HYPERLINK only creates a clickable text that opens another file; it doesn’t pull in data. IMPORTRANGE actually imports and syncs cell contents from the other file.
Wrapping Up
Linking to another Google Sheets file can boost your productivity and keep your data connected across multiple sources. Whether you’re pulling live data with IMPORTRANGE, creating quick-access links using HYPERLINK, or automating link creation with Apps Script, there’s a method to suit every workflow. Each tool offers unique benefits depending on your needs, including manual access, dynamic syncing, or scalable automation.