To join two sheets in Google Sheets, decide whether you need to stack their rows, match records using a shared key, or bring data in from another spreadsheet. For tabs in the same spreadsheet, you can combine rows with an array formula; for separate files, use IMPORTRANGE before combining or matching the data.
What “joining sheets” can mean
People use “join” to describe several different tasks. Picking the right one matters: stacking two lists is not the same as looking up a customer name for each order. In Google Sheets, the common goals are:
- Append rows: put records from one tab beneath records from another, such as January and February sales.
- Match records: use a shared value, such as an order ID, to bring related columns from one tab into another.
- Combine columns: place data side by side, usually when corresponding rows are already in the same order.
- Bring in another file: connect to data in a separate Google Sheets spreadsheet.
These are data operations, not the same as merging cells. The menu command for merging cells changes the layout of cells in a selected range; it does not combine two worksheets’ records. A good first question is whether a row in one sheet corresponds to a row in the other by position or by a unique identifier.
Stack rows from two tabs in one spreadsheet
Use this approach when both tabs have the same kind of records and the same columns. For example, suppose the January tab has headers in row 1 and sales in columns A through C, while February has the same headers and layout. Put the formula in an empty area of a third tab, or in an unused part of a tab.
With headers in January!A1:C1, January records below them, and February’s matching headers in February!A1:C1 with records below, enter:
=QUERY({'January'!A1:C; 'February'!A2:C},"select * where Col1 is not null",1)
The braces make a combined array, and the semicolon stacks the second range below the first. Starting the February range at row 2 avoids repeating its header. QUERY keeps rows whose first column is not blank, and the final 1 tells it that the combined data has one header row. The result updates when source cells change. The formula assumes column A is populated for every record you want to keep; if that column can legitimately be blank, filter on a different always-filled column or remove the condition.
Replace the tab names and column range with your actual names and data. A tab name containing spaces still goes in single quotes, as in 'Q1 Sales'!A1:C. Make sure both ranges have the same number of columns and that each column means the same thing in both tabs. If the two tabs use different column orders, rearrange the source columns before stacking or the output will mix unlike values.
Match records by a shared key
If one tab contains orders and another contains customer details, stacking rows would not create a useful result. Instead, look up a value using a shared key such as a customer ID, email address, or order number. A key should identify the intended record unambiguously; a person’s name alone may not do that if names repeat or are spelled differently.
For example, assume the current sheet has customer IDs in A2:A, and the Customer list tab has IDs in column A and names in column B. To return the matching name beside the first ID, enter this in B2:
=IFNA(VLOOKUP(A2,'Customer list'!A:B,2,FALSE),"Not found")
Here, FALSE requests an exact match, and IFNA displays a readable message when the ID is not found. Fill the formula down for the remaining rows. The lookup range must begin with the key column, and the number 2 tells VLOOKUP to return the second column in that range. To return another field, adjust the range and column number accordingly. For a large dataset, a formula that refers to a whole column can be convenient, but bounded ranges can be easier to inspect and may avoid processing unnecessary empty cells.
Combine data from separate spreadsheet files
For a source stored in a different Google Sheets file, use IMPORTRANGE to connect the file to your destination spreadsheet. The first argument can be the source spreadsheet’s URL or ID; the second is a range written as a string, including the source tab name.
With the source spreadsheet URL or ID available, and the source tab named January with data in A1:C, enter:
=IMPORTRANGE("spreadsheet_URL_or_ID","January!A1:C")
Replace the text in the first argument with the actual URL or ID. The first time you connect to a particular source, Sheets may show #REF! and ask you to allow access. Approve the connection if you are authorized to view that file. Importing does not bypass the source file’s sharing permissions, and a person without access should not expect the data to load.
To append imported rows to local rows, you can combine a local range and an IMPORTRANGE range in an array, using the same row-stacking idea as above. If the formula is hard to troubleshoot, first put IMPORTRANGE in a spare cell and confirm that it returns the expected data. Then build the combined formula. This separates permission or range errors from problems in the array or query.
Choose formulas, copying, or a lookup tool
A formula is usually the best choice when the joined result should stay current as source data changes. It also leaves the original tabs intact, making the process easier to audit. A one-time copy and paste can be simpler when you only need a snapshot and do not need later updates. Copying is not a live connection: edits to the original do not automatically change the pasted copy.
- Use a row-stacking formula for lists with matching columns that need to become one longer list.
- Use a lookup formula when records need to be matched by an ID or another shared field.
- Use IMPORTRANGE when the source is in a different Google Sheets file and you need a live imported range.
- Copy and paste values for a one-time snapshot, after checking that the copied columns and headers line up.
For a large recurring import or a transformation with many steps, consider whether a purpose-built data workflow is more maintainable than one long formula. In Google Sheets, functions such as QUERY can filter and select columns from a range, but the right choice depends on how often the source changes and who needs to maintain the result. Excel has different menus and spreadsheet features; instructions for Excel, including its Power Query workflow, are not the same as Google Sheets steps in a browser.
Prepare the source sheets before joining
Clean, consistent inputs make a join more reliable. Before combining, check that headers describe the same fields, dates are stored consistently, and IDs do not contain accidental spaces or different formats. A number stored as text may fail to match the same-looking number stored as a numeric value. Similarly, 0017 and 17 may represent different identifiers depending on the system that created them.
It also helps to remove repeated header rows from the body of the data and decide how to handle duplicates. If two source tabs contain the same transaction, stacking them will keep both copies; a stacking formula does not know that they are duplicates. If duplicate records should be removed, define what counts as a duplicate first, such as identical order IDs, and then use a suitable cleanup step rather than assuming the join will resolve them.
Common errors and how to fix them
- #REF! from IMPORTRANGE: Check the spreadsheet URL or ID, the tab name, and the range spelling. If the connection is new, select the option to allow access. Also confirm that your account can open the source file.
- Array literal errors: Check that stacked ranges have the same number of columns. In an array literal, a semicolon separates rows and a comma separates columns in the usual English-language locale. Spreadsheet locale settings can affect separators, so adjust them if Sheets flags the formula syntax.
- Missing lookup results: Check for extra spaces, inconsistent text-versus-number types, and duplicate keys. Exact-match lookups need the key values to agree; visually similar values are not necessarily identical to Sheets.
- Unexpected blank rows: Open-ended source ranges may include many empty rows. A
QUERYcondition can omit rows where a chosen key column is blank, but use a column that is reliably filled for valid records. - Wrong columns in the output: Compare the source headers in order. A stacked result aligns by position, not by header label, so “Date” in column A on one tab and “Date” in column B on another will not be automatically reconciled.
When a complex formula fails, reduce it to the smallest working piece. Verify each source range, test an import by itself, and then add the array or lookup logic. This is often faster than editing several parts of a long formula at once.
Frequently Asked Questions
Can I join two Google Sheets tabs automatically?
Yes. A formula that stacks or looks up data recalculates when its referenced cells change. For another spreadsheet file, IMPORTRANGE can bring in a source range after access is granted. A manually pasted copy, by contrast, is a snapshot.
How do I combine two sheets with the same columns?
Stack the rows, leaving only one header row. For tabs in the same file, an array formula such as the QUERY example above can place one range beneath another. Confirm that corresponding columns have the same meaning and that both ranges have equal width.
How do I join sheets using an ID?
Use an exact-match lookup such as VLOOKUP to find the ID in the other tab and return the related field. Make sure the key is in the first column of the lookup range and that the ID values have compatible formats.
Does “Merge cells” combine two sheets?
No. Format > Merge cells changes how selected cells are displayed within a sheet; it does not join records or tabs. Use a formula, import, or copy-and-paste workflow to combine data.
Can I join sheets from two different Google accounts?
Potentially, if the account using the destination spreadsheet has permission to access the source file. IMPORTRANGE needs authorization for the connection, and the source owner’s sharing settings still control access.
Keep the joined result dependable
Document which tabs and columns feed the result, and keep the output separate from the source data when possible. That makes it easier to spot an accidental change and reduces the risk of overwriting original records. After creating the join, compare a few results against the source tabs, including a record near the bottom of each range and a key that should not match. A quick check can reveal a shifted column, omitted header, or mismatched identifier before others rely on the combined sheet.
Related
- Inventory Spreadsheet: Simple Setup and Useful Tips
- Inventory List Spreadsheet Template: Build and Use One
- Google Sheets Inventory Spreadsheet: Setup and Tips
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Can You Make Columns in a Text Box in Microsoft Word?Yes. In desktop Microsoft Word, select the text box and use Shape Format > Columns to divide its…
- Outlook Signature: How to Create and Set It Up for EmailTo create a signature message in Outlook, open the signature settings for your version, add your name and…
- Excel Keyboard Shortcuts: Options for Every TaskExcel keyboard shortcut options include built-in key combinations, ribbon Key Tips, the Search box, and commands added to…
- Conditional Formatting Excel: Color an Entire RowYes. To color an entire row in Excel based on one cell, select the rows you want formatted,…
- Excel Table Image: How to Insert and Manage PicturesTo put a picture in an Excel table, select a cell and choose Insert > Pictures > Place…
- How to Create a Distribution List in OutlookTo create a personal distribution list in Outlook, open People, choose New contact list in new Outlook or…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.