Using Importdata to pull another googlesheet - google-sheets

I'm trying to use importdata in one google sheet to pull data from another google sheet. I'm avoiding importrange because the file is used as a template and needs to be copied. reloading and re-allowing the data every time is time consuming and annoying.
The steps I currently take:
Take the data source sheet and "Publish to the web"
in the template sheet, =query(importdata("<LINK of Datasource>", "Select Col1, Col2, Col3", 1)
This returns the HTML code of the sheet instead of the data table. Is there a way to import the actual table from the data source sheet?

Related

Can you pull information from another sheet dynamically such that it is effectively a join?

I am tracking my stock purchases using Google sheets. I have separated the stocks that I have purchased into their own sheets and have an overview page
I want the data in the external sheets to automatically populate the overview list, where the overview stays up to date with the source sheets, and remain sorted by date.
This is the outcome I am looking for, though I made it manually:
Example sheet:
https://docs.google.com/spreadsheets/d/1okVUHw7DKDbzIwNHE1f38Ew81dEO_n27nrgyYV9zLzs/edit?usp=sharing
Try below query formula. See the sheet link harun24hr.
=QUERY({QUERY({VAP.ASX!A2:A,INDEX(SUBSTITUTE(VAP.ASX!G2:I2&SEQUENCE(ROWS(VAP.ASX!A2:A),1,1,0),"1","")),VAP.ASX!B2:E},"where Col1 is not null",0);
QUERY({UMAX.ASX!A2:A,INDEX(SUBSTITUTE(UMAX.ASX!G2:I2&SEQUENCE(ROWS(UMAX.ASX!A2:A),1,1,0),"1","")),UMAX.ASX!B2:E},"where Col1 is not null",0)},"order by Col1",0)
Google-sheet Link

Data Validation from seperate google sheets workbook

i am trying to create a dropdown menu in a g-sheet in workbook A that looks at a list in a sheet in a seperate workbook B.
i know i can do this by creating a new sheet in workbook a and using the import range function to link to the range in workbook b and then data validate it to the sheet i want to have the dropdown menu in.
my question is can i do this dropdown menu without creating a new sheet in workbook a and using the importrange function. can i just data validate it directly to the sheet in workbook b? both workbooks are in the same folder in the drive.
thank you in advance. no end of googling this has helped
An alternative that I have used when working with Sheets, is utilizing the "QUERY" Function.
For example Sheet1 is my primary workbook and need data from the second workbook called "Sheet2" to be placed under the primary:
=QUERY(Sheet2!$A$2:$H$7, "select B, MAX(D) group by B order by MAX(D)")
The example query is an edit from the official documentation a link!

Import named range data between Google Workbooks

If within the same Google Sheets Workbook, the formula: index(namedRangeRow , namedRangeColumn) works beautifully to "pull" or extract the piece of data residing at the intersection of the named row and named column onto another Sheet in the SAME Workbook.
How do I write a formula to get the same effect when I want to pull data from a DIFFERENT Workbook? I presume it is importRange, but I can't seem to get that formula to recognize two named ranges and find the data at the intersection thereof.
The formula: importRange("key", "namedRangeRow") works great, but it pulls all the data in the target Workbook range. So, I presume it's some variation of that formula, I just can't find the right way to express the two ranges within the importRange function.
The formula in the image below pulls a value in a cell at the intersection of two named ranges from a separate Google spreadsheet (i.e., workbook). (Link to sheet.)
The sheet where the data resides is below. (Link to sheet.)
The SetLinkData sheet is the 2nd sheet in the Set List workbook as in the pic below and contains the ID of the Song Catalog sheet.

data from specific google spreadsheet tabs

I know how to query data from google spreadsheet with the general share link, but I want to pull data from specific tabs in that shared workbook. How do I do this?
It is not clear from your question how you are querying a spreadsheet (there are several ways to do it).
If you are using spreadsheet data source url (e.g: https://docs.google.com/spreadsheets/d/{ss_key}/gviz/tq?tq=...), then you can add gid or sheet url parameters to specify which sheet in the spreadsheet to query by its id or name:
https://docs.google.com/spreadsheets/d/{ss_key}/gviz/tq?gid=0&tq=...
https://docs.google.com/spreadsheets/d/{ss_key}/gviz/tq?sheet=Sheet1&tq=...
You can get the gid number of a sheet from the spreadsheet's url when it is open in your browser. More info here: https://developers.google.com/chart/interactive/docs/spreadsheets#Google_Spreadsheets_as_a_Data_Source
Note: data source url examples above are for new google sheets. If you are still using old sheets, the url format will be different: http://spreadsheets.google.com/a/google.com/tq?key=ABCDE&tq=.... The documentation link above still uses old sheets url format.
If you are querying your spreadsheet via QUERY() formula in another sheet, then just specify the name of the sheet you want to query in the data attribute of the function:
=QUERY('Example Data'!$A$2:$H$7, "select A where (B<>'Eng' and G=true) or (D > "&A2&")")

Locate 'targeted' data in one spreadsheet document and import it into another

I'm trying to find out 'how' to use collected form data to retrieve targeted data from a separate Google spreadsheet (source) and insert it into the response spreadsheet (target).
The google form is here, the target spreadsheet is here, and the source spreadsheet is here.
The goal is to locate student data in the 'source' spreadsheet based on the Student ID# and Period that is submitted via the Google from. Then pull the student name and correct period teacher (name & email) from the 'source' into the 'target'.
I originally thought I would use Vlookup function, but then I realized I can not because the source spreadsheet and the target spreadsheet a separate documents. Now I believe the Query function is what I need to use, but I'm not sure how to structure the function.
So far, I have this, but it doesn't work 'yet'
QUERY(importRange("0AoV45G_-cBI0dGZsUU9VbnFFb3BwQmItSmR6cDR4aUE&usp", "Sheet1!A1:G"), "select Col1, Col2, Col3 where Col2='data1'", 1)
I'm really confused on this part
"select Col1, Col2, Col3 where Col2='data1'", 1)
I only want to copy two columns based on the student ID # (student fname, student lname) and then two columns based on the period (teacher, teacher email).
Any suggestions?
Import all students: I would import all of the source sheet into a new sheet in the destination spreadsheet using importRange, then use VLookUp as was your plan.
I am not sure Query will work in the way you want. I.e. there is no way to merge data from two ranges. So you would end up with a ImportRange for every student.
ImportRange: "Note: The limit on the number of ImportRange functions per spreadsheet is 50."
Eddy.
Spreadsheet forumlas that build web applications

Resources