Equivalent of Google Sheets Importrange
What is the equivalent of google sheets =IMPORTRANGE function in MS Excel?
=QUERY(IMPORTRANGE("1yH4Y1bz4zchsC0TFuWkJsAaL_XXXruNHf56BOiNJIM","Another sheet!A:M"),"select Col1,Col2,Col4,Col8",1)
E.g., I'd like to automatically import some columns from another sheet in the same workbook. How do I do it?
Solution 1:
On the Data menu, there will be an option to get from other sources
From this use Microsoft Query
You can then select Excel File as your source, and pick the file that has the data you wish to import.
You can also add any criteria you need, and sorting on the subsequent screens.
This will leave you with a table that you can refresh when needed.
Solution 2:
Data ribbon > Get Data > From File > From Workbook
Browse to the file, select it, and click Import
Select the data you want to import. Excel really wants this data to be in a table format. Wherever possible, I'd recommend importing the entire sheet.
If you want to get particular, you can click Transform Data
to open up the power query editor. From there, you can pick particular columns or a certain number of rows. It's not straight SQL but you'll figure it out if you're familiar with the QUERY()
function in Google Sheets.
Excel turns your data into a table and opens the Queries and Connections sidebar. Right-click on the query in that sidebar and then click Properties...
.
Check the Refresh every
box and change the number of minutes as desired.