Formula (Array, etc.) for automatic Google Sheets Indexing using inputs from Google Forms - google-sheets

I'm hoping that someone can help me tweak (or even substitute) a formula that I'm using in Google Sheets to automatically populate columns with information based on inputs from a Google form.
Simply put, I am using the Index function to match the name that is selected from a drop-down menu in the Google Form and arrives in Column E of the Google Sheet receiving the responses with an identical list of names in Column A of 'Sheet 2'. The index formula takes information from 'Sheet 2' relating to that name (e.g. Registration Number, Email Address) and places it in the 'Formresponses 1'sheet alongside the inputs from the Google form (including, of course, the name that appears in Column E'.
I have been using (variations on) the following formula without any issues, but I have to manually drag it down the relevant column in 'Formresponses 1' each time a new entry/name arrives from the Google Form: =index(Sheet2!$B$2:$B,match(E2, Sheet2!$A$2:$A,0),1)
I have successfully used Array Formulas to automatically carry out other functions on data arriving from a Google Form (i.e. adding up individual numbers to arrive at an overall total), but in this case I cannot figure out how to create a formula that will automatically take each new name that arrives in column E and insert it into the relevant indexing formula at that end of that new row.
Any suggestions - or solutions! - would be greatly welcome!
Thanks,
A.

Cheers I'-'I,
I've used I'-'I's response to my original question here as a starting point and, with a bit of research, I've come up with the following working formula:
= ArrayFormula(vlookup(E2:E, Sheet2!A:E, {1,2,3,5},FALSE))
[The curly brackets simply indicate the columns in Sheet 2 from which I want to pull pieces of data relating to each name that is matched up in the 'front end' sheet receiving the responses from the Google Form.] As with my previous problems with array formulas, I found the following website really useful, so full credit has to go to it: benlcollins.com

Related

Google Sheets - Grab data from a separate sheet and add it to a master sheet

I have a Google Sheet that has a main master sheet, with a column for users to fill in their Name to show they are "working" on that row, then that row gets populated to their own tab based on a =QUERY(Master!A3:AA,"select * Where L='Name'") for each of the users' tabs, there is 8 total tabs where users are updating information. This is already quite a bit of processing on Googles part, so I am trying to generate a separate Google Sheet that pulls in the information that the users are entering on each of their tabs so the management can monitor that sheet for updates and then both sheets will run a lot faster/smoother.
I have tried using a VLookup with this syntax: =vlookup(A3,importrange("sheetID",{"Name1!$A$3:$N";"Name2!$A$3:$N";"Name3!$A$3:$N";"Name4!$A$3:$N";"Name5!$A$3:$N";"Name6!$A$3:$N";"Name7!$A$3:$N";"Name8!$A$3:$N"}),12,FALSE) which gives me an #N/A Error, cannot find Value '1' in VLOOKUP evaluation.
I have also tried using a =QUERY({importrange("sheetID"x8 with the ranges)}, "Select Col12,Col13,Col14 where Col2 matches '^.\*($" &B3 & ").\*$'")
That only returns headers, I am trying to get the query to basically find the unique key in Column A then spit out what is in Col 12-14, but that doesn't seem to work either. Columns 1-11 are static, but Columns 12-14 are what I am trying to populate for the management, which is the work that the staff is inputting on each of their tabs.
I can get the query working if I keep it on the same worksheet as the one the staff is working on, but then it bogs down the whole sheet so I would like to keep it separate if possible. Any ideas? I can't provide a sample sheet at this time since it has financial info on it, but I can add more details if I know what to look for.
your formula should be:
=VLOOKUP(A3, {
IMPORTRANGE("sheetID1", "Name1!A3:N");
IMPORTRANGE("sheetID2", "Name2!A3:N");
IMPORTRANGE("sheetID3", "Name3!A3:N");
IMPORTRANGE("sheetID4", "Name4!A3:N");
IMPORTRANGE("sheetID5", "Name5!A3:N");
IMPORTRANGE("sheetID6", "Name6!A3:N");
IMPORTRANGE("sheetID7", "Name7!A3:N");
IMPORTRANGE("sheetID8", "Name8!A3:N")}, 12, 0)
keep in mind that every importrange needs to be run as a standalone formula where you connect your sheets by allowing access. only then you can use the above formula

Collecting crowd-sourced data in tabular or spreadsheet format

Full disclosure: I originally posted this to the SE/Web application site but garnered zero comments amidst 15 views. Hoping for a better outcome here.
I'm involved in a citizen-science project polling recreational anglers about their preferred ocean fishing locations (lat-lon), a few characteristics about the location (depth, what species they catch, etc.), and some voluntary contact information. In spreadsheet form with each row being a unique location, there would be about 10 columns (each column being the response to a question).
I did a trial run with a small number of respondents using a Google Form that compiles all the responses to a Google Sheet, but due to limitations in Google Forms, respondents must submit a new form response for each fishing location they wish to provide. Every respondent said it was tedious and would prefer entering the data directly into a spreadsheet versus scrolling through 10 questions and submitting multiple forms to provide multiple locations.
Is there a process where I can distribute a link to potentially hundreds of people (who can in turn share that with whomever they wish) where the respondent is presented with an empty spreadsheet they populate with their responses? It would require that the field headers can't be edited and no one can see anyone else's responses. The spreadsheet would just look empty to each respondent. On the back end, the responses would be compiled into a single spreadsheet, much like how a Google Forms/Sheets works now. Google Forms is close - if they would just allow users to embed a Google Sheet in the form itself, I'd be set, but that's not possible at this time.
Edit - this is what the spreadsheet would include. Sorry I don't know how to properly embed or format this in tabular form. What each respondent would see is these column headers in a completely clean spreadsheet. They'd enter their data and submit, and on the back end, I'd have a master version of this that would append add each new location row-wise as they are submitted.
RowID | Latitude | Longitude | Target species 1 |Target species 2|Target species 3 | Habitat type| Home port | Name |Email address
click on this: https://docs.google.com/spreadsheets/create
copy-paste this fx in A1
=SPLIT("RowID|Latitude|Longitude|Target species 1|Target species 2|Target species 3|Habitat type|Home port|Name|Email address", "|")
copy the url
change edit#gid=0 to copy
take that URL and send it to your buddies and ask them to send you their URL of the sheet and enable sharing
or you can create those sheets for them and give to each of your people one spreadsheet
then create a new spreadsheet (master sheet) and use this in A2:
=QUERY({
IMPORTRANGE("url1"; "A2:J");
IMPORTRANGE("url2"; "A2:J");
IMPORTRANGE("url3"; "A2:J")}; "where Col1 is not null"; )

Trying to index match information from 1 google sheet to another

I have the following 2 google sheets
TEST 1
https://docs.google.com/spreadsheets/d/1mAssNMTGXcMcuYhjDWq6lNfWOdgUfI6FbGSWushGAMg/edit?usp=sharing
TEST 2
https://docs.google.com/spreadsheets/d/15PAI8nnTzp1wQuvvkHxZ81kkeRrqHrvUH1vXiF9tya0/edit?usp=sharing
In Test 2 in cells B36,B37 and C36,C37 I am trying to grab information from TEST 1 to TEST 2
I have checked and checked and triple checked but I am not sure why it is not grabbing the information over.
Previously I had used "-" and "( )" in the table names so I decided to remove all of those and use only letters but it is still not working.
I also noticed that it was grabbing from the correct column (in my original google sheet), column D but it was grabbing the wrong information.
But I checked the name I was using to match "Room BS Harvest" and made sure it matched in both google sheets but still was not able to get it to work.
I have turned on show formula so you can see that I have formulas in Test 2 B36,B37,C36,C37
If you have any idea why it is not working please do let me know. I can't figure out why it is not getting the data over.
I myself would not approach things the way you are doing in this sheet. (I always recommend using a separate sheet within your destination spreadsheet where IMPORTRANGE brings in all of the data from the source location, and then using that single sheet in the destination spreadsheet as the reference for all other formulas, such as the ones you're trying to use.)
In addition, your sheets are inaccessible (i.e., "Comment only"). So neither I nor anyone else would be able to setup an alternative method for you to consider.
That said, and working with what you do have, here is how you might adjust the B36 formula...
Here is the formula you originally wrote (and which is not working):
=INDEX(importrange("https://docs.google.com/spreadsheets/d/1mAssNMTGXcMcuYhjDWq6lNfWOdgUfI6FbGSWushGAMg/edit#gid=0",$J$1&"!A4:H26"),MATCH($A36,index(importrange("https://docs.google.com/spreadsheets/d/1mAssNMTGXcMcuYhjDWq6lNfWOdgUfI6FbGSWushGAMg/edit#gid=0",$J$1&"!A4:A26"))),match($J$2,index(importrange("https://docs.google.com/spreadsheets/d/1mAssNMTGXcMcuYhjDWq6lNfWOdgUfI6FbGSWushGAMg/edit#gid=0",$J$1&"!A4:H4"))))
Here is my edit to that formula structure (which should work):
=INDEX(IMPORTRANGE("1mAssNMTGXcMcuYhjDWq6lNfWOdgUfI6FbGSWushGAMg",$J$1&"!A4:H26"),MATCH($A36,IMPORTRANGE("1mAssNMTGXcMcuYhjDWq6lNfWOdgUfI6FbGSWushGAMg",$J$1&"!A4:A26"),0),MATCH($J$2,index(IMPORTRANGE("1mAssNMTGXcMcuYhjDWq6lNfWOdgUfI6FbGSWushGAMg",$J$1&"!A4:H4")),0))
Notice that you only need the spreadsheets ID number for IMPORTRANGE, not the entire URL. This just makes reading such formulas easier.
You also had mismatched sets of parentheses. This was your biggest issue.
And I recommend using the third parameter of MATCH to indicate what kind of match you're looking for. (Here, I assigned 0, which means "exact match only.")
Hopefully, you can use that as a model for editing your other formulas.

Query Importrange in Google Sheets Not Importing Correctly

We are using Google Forms to collect data on our students. They use the same Google Form for all students, but as part of the form, they are asked the students name.
The data that ends up being collected you can see on the tab Form Responses 1 on the Google Sheet linked here.
I am attempting to use ImportRange to create a tab for each of the students. The formula that I am using for just one of the students is...
=QUERY(IMPORTRANGE("1nJANDP1fiQunxfxEf-EjwJrnIRICv6kLhYYY9XBXtD4", "Form Responses 1!A:I"),"SELECT * WHERE Col3 = 'Adam N.'")
You can take a look at the tab called Adam N. and you'll see it is kind of working.
One thing that doesn't seem to be working is when there is a text value in columns E-I, that text value doesn't end up showing on the Adam N. tab. Any ideas how I can get both the numbers and the text values to show up?
The other thing that seems to be a problem is the fact that on the Adam N. tab, the very first row has the same headers as the Form Responses 1 tab, but it also has the very first line of data. Any way to remove that?
Importrange is not needed since you are 'importing' from within the same spreadsheet. Also, I'd recommend using the (optional) header argument in query().
It is often noted that users are tempted to mix data types within a column. The query() function will give undesirable output. If a column is intended for numeric values then only numerical values must reside in that column. Date columns must only contain dates and text columns only contain text values.
This does not mean that numbers cannot appear in a text column as long as they are in a text format. So it is important to plan the columns in a table to make sure this rule is maintained regardless if the data table is created manually or via submissions from a Google Form.
Generally, the query() function will assume the greater number of cell types in a column to be that data type. For example, if there are 100 numbers and 20 text values in the same column then a numeric value will be assumed for that column. There is a good chance the text values will just be ignored. One way to avoid this, would be to convert everything to text.
See if this works
=ArrayFormula(QUERY(to_text('Form Responses 1'!A:I),"WHERE Col3 = 'Adam N.'", 1))

How do i stop google sheets skipping a row with my formula when a new answer is entered?

Every time a new row of answers is added the formula on another shit will skip the already referenced rows where the new data has just been added.
If i manually drag it down across a number of fields it updates properly and shows the correct number. However if i already have it in those fields when an answer from my google form is entered instead of it updating to show the correct number it stays as 'False' , as it would do when referencing a blank field, and the field reference goes up by one skipping the field it was already referencing.
I've tried absolute referencing with "$b2" and moved it to different positions however it still skips the row it was meant to be referencing. Any idea on how to stop this. Code is below-
=IF('Form Responses 1'!B$16 = "dog","1",IF('Form Responses 1'!B$16="Cat","2",IF('Form Responses 1'!B$16="Frog","3",IF('Form Responses 1'!B$16="Bird","4"))))
Essentially there are three columns, Timestamp, Pick a word and email. Those are populated automatically by the google form in to the sheet "Form Responses 1". The column i'm working with is B which is Pick a word. If that cell equals a certain word the corresponding number is outputted in the field with the formula in it. When new data is entered in to B16 for example on Form Responses the formula on the other sheet will change B16 to B17 and skip that row.
Any help is appreciated and I've got a fair understanding of the formulas so don't worry about going in to too much detail :)
Just answered a similar question here.
The workaround is to use INDIRECT() with ROW()
=IF(INDIRECT("'Form Responses 1'!B"&Row(A16)) = "dog","1",IF(INDIRECT("'Form Responses 1'!B"&Row(A16))="Cat","2",IF(INDIRECT("'Form Responses 1'!B"&Row(A16))="Frog","3",IF(INDIRECT("'Form Responses 1'!B"&Row(A16))="Bird","4"))))
Or
=IF(INDIRECT("'Form Responses 1'!B"&Row(A1)+X) = "dog","1",IF(INDIRECT("'Form Responses 1'!B"&Row(A1)+X)="Cat","2",IF(INDIRECT("'Form Responses 1'!B"&Row(A1)+X)="Frog","3",IF(INDIRECT("'Form Responses 1'!B"&Row(A1)+X)="Bird","4"))))
Where X is your offset.
Hope this helps

Resources