Merging data is often a task handed off or outsourced to third party consultants. This is due to the fact that it can be tedious and time-consuming, but there are ways to avoid merging data one item at a time, and that is by using the Google Spreadsheets Key.
By leveraging the Google Sheets Key with query functions (and more specifically, by combining the query function with the IMPORTRANGE feature) you can save time and resources at your small business.
First, focus on the Query function so that you will be able to consolidate data from multiple sheets using a formula. It is very simple to learn and once you have the formulas written down you can customize them to your liking.
Essentially this is a formula that makes you able to import data in a range of cells from one or more Google Sheets into one. The key identifies which Spreadsheets you are importing the data from. This technique of merging data from multiple spreadsheets can help you avoid putting in large amounts of work, manually migrating data between Google Sheets.
There are some keys that are specific to actions, but each individual spreadsheet has its own Google Sheet key.
This can be found in your published Google sheets URL. To find this simply select the string of data found between the slashes after “spreadsheets/d” in your Google Sheet URL:
There are many benefits to using the query function as well as benefits to consolidating your data:
The base formula to utilize the Google Spreadsheets key is:
IMPORTRANGE(spreadsheet_key, range_string) |
Range_string: Use to reference a specific cell or group of cells in your sheet
An example used to show the range of cells to import: Sheet1!B3 (this would import the data in cell B3 from Sheet 1).
There is also the option to use a formula based on tab names: My tab name!B3 (this would import the data in cell B3 from "My tab name").
This option is not necessary, and as a default the IMPORTANGE formula, the Spreadsheet will import the range from the first available sheet.
IMPORTRANGE ( "spreadsheet_key", "range_string" ) |
*Note: Make sure to place both variables in Quotes " "
=IMPORTRANGE("1o62M-deXGSI32Fdn9WlGDIR7uMFkBMSu9xb1nKR7KE4","Sheet2!A20") |
And this is what you should see when you enter the above formula in your Google Sheet:
=query({janjunefunds!A2:H5;julydecfunds!A2:H5},"Select * where Col1 is not null ") |
{janjunefunds!A2:H5;julydecfunds!A2:H5;2019extrafunds!A2:H5} |
=query(Combined!A1:H10,"select D, sum(H) where A is not null group by D") |
In order to combine the two formulas simply use:
=query({janjunefunds!A2:H;julydecfunds!A2:H},"select Col4, sum(Col8) where Col1 is not null group by Col4") |
Just remember that if you're expecting people in your organization to pull data from your Google Sheets, you'll have to share that spreadsheet with them first, so they have permission to access it and import it into their spreadsheet.