Brought to you by:
Welcome to the Google Sheets Tips newsletter #327, your Monday morning espresso, in spreadsheet form! Recently a reader asked about a problem importing data from one Sheet to another when the sheet names were changing. Below, we look at how to solve this and see yet another benefit of the new Google Tables feature. My family and I spent the weekend at Fairmont University in West Virginia, where my eldest son was competing in a Lego robotics competition. With his teammates, they built an autonomous robot that navigated a table-top world to retrieve items, knock things over, lift things, etc. Teams were scored on how many missions they completed. They use a system called Lego Spike and code it with the Scratch language (block programming). Super proud of them for finishing 6th out of 51 teams from across the State. ➜ NewsI. II. ➜ Sheets Tip #327: Yet another benefit of Tables in Google SheetsThe IMPORTRANGE formula is a special formula that transfers data from one Google Sheet file to another Google Sheet file. Because our Google Sheets exist as files in the Cloud, we can't simply click to connect them in the way you would do with Excel files on the desktop. Hence, we have the special IMPORTRANGE function. A standard IMPORTRANGE formula imports data from one Google Sheets file into another: =IMPORTRANGE("https://docs.google.com/spreadsheets/d/XXXXXXXXXXX/edit#gid=0","Sheet1!A1:G11") where the URL is the source Google Sheet and the range reference refers to the portion of data we want to import, e.g. A1:G11 in Sheet1 in this example. However, this formula is brittle because:
In both cases, we have to update the range reference in our IMPORTRANGE formula. So, how can we make it more robust? Enter Tables! Select the source data and convert it to a Table: Format > Convert to table Then use the table name (e.g. "Table1") in our IMPORTRANGE formula: =IMPORTRANGE("https://docs.google.com/spreadsheets/d/XXXXXXXXXXXXXXX/edit#gid=0","Table1[#ALL]") Use Table1[#ALL] to get the data AND header row. Use Table1 to get the data only. Now, if we rename the sheet in the source file, or add rows or columns, the data will still be imported, automatically. It also has the added benefit of making our IMPORTRANGE formula more readable too. Great stuff! If you enjoyed this newsletter, please forward it to a friend who might enjoy it. Have a great week! Cheers, |
Get better at working with Google Sheets! Join 50,000 readers to get an actionable tip in your inbox every Monday.
Hi Reader, Welcome to the Google Sheets Tips newsletter #328, your Monday morning espresso, in spreadsheet form! This is the last Google Sheets Tips newsletter for 2024. A big thank you for being part of this journey and reading these tips. Your Monday-morning-espressos-in-spreadsheet-form will return on the 6th of January 2025. In the meantime, I wish you all a wonderful holiday season with your loved ones. Tip 328—creating a 2025 calendar with a formula—is found below, but first: ➜ 2024 In...
Brought to you by: Hi Reader, Welcome to the Google Sheets Tips newsletter #326, your Monday morning espresso, in spreadsheet form! Last week, we looked at the concept of "walking the first row" to understand your data. This week, we're pairing that with the Column Stats tool. Using both of these techniques will ensure you have a full understanding of what's in your dataset and a good sense of the metrics (e.g. row count). Check it out below! Also, there is no Google Sheets Tips email next...
Brought to you by: Hi Reader, Welcome to the Google Sheets Tips newsletter #325, your Monday morning espresso, in spreadsheet form! Finally, an AI invention that has me truly excited... Behold the AI-powered laundry robot 🤖 Thank you boffins, this is more like it! How long until we can get one? Imagine what we could all do with those extra hours each week... In today's newsletter, I'm sharing a piece of advice that a mentor gave me early in my career. It's brilliant in its simplicity and has...