How to do Indirect on a range reference of cells with Google Sheet [duplicate] - google-sheets

In a google sheet linked with a google form, I am putting
=ARRAYFORMULA(Responses!$A$2:R500)
in a blank sheet(namely dataList) to copy raw data from the response sheet so it is more readable and manageable.
After submitting some test data, I need to clear them and publish the form for production use. If I simply select the rows and hit "delete" on my keyboard, when new submission comes in, it will not appear on the first row(or row 2), instead it remembers how many rows there were and put the new data on the next row, thus leaving the first rows blank on both of the sheets, which is unacceptable. So I select the rows with test data in the sheet Response and delete the rows:
Now when new submission comes in, it does appear on row 2 in Sheet Response; however, when I go to my "dataList" sheet, it is like this
The A1 notation which is supposed to be absolute has been altered, hence my dataList sheet doesn't get the new submission data from sheet Response.
How to deal with this unwanted behavior?

you can freeze it like:
=INDIRECT("Responses!A2:R500")
instead of your:
=ARRAYFORMULA(Responses!$A$2:R500)

If you want to avoid string ranges or INDIRECT, you could use INDEX:
=INDEX(Responses!A:A,2):INDEX(Responses!R:R,500)
This always takes the second row from A:A and 500th row of R:R regardless of the deleted rows.
Advantage:
This can be drag filled. It can change based only on certain conditions.

Related

Importing data from another sheet where the entire row is not duplicated

I have a Google Sheet which has basic test data.
I need to import every row where the entire row is completely unique.
If any data in a row is different it should pull through to the other sheet.
Here is my test sheet with the data in 'Duplicate Rows'! and the data pulling through as is into 'Import'! https://docs.google.com/spreadsheets/d/1D1H2FLdyzr2iFwr_ENg6t2OAAsS8f71Mb4P5T_dtJ6g/edit?usp=sharing
I was going to use data validation to remove repeated rows from in the imported sheet but I can't find advice online that will consider the entire row rather than duplicate cells.
Either way I need to prevent these repeated rows.
You can use
=INDEX(UNIQUE(A1:C8))
(Do adjust the formula according to your ranges and locale)

How to get sum/difference From a different sheet using dates as reference?

Collections Sheet
Expenses Sheet
Hi, I would like to get the daily sum/difference of the expenses from the expenses sheet then output to collections sheet using dates as reference/identifier.
I tried this code =MINUS(C8,INDEX(Expenses!20:31,12,2)) but I want it to auto compute when I drag the box. sorry for bad english. thank you
Desired output:
Desired Output
Output at (Net) Cash On Hand Row / Reference Date Column, the output should be August 1 Collection - August 1 Expenses.
The main issue is with the structure of your expense sheet, since you need to use only every second column. For this you can use various methods, something like
=split(substitute(join(";",Expenses!A2:DJ2),"Total:;",""),";")
The join function takes the whole row and joins it into one string, the substitute function removes the Total: from it, along with the trailing ; and the split function separates it again to separate values. This will be an array, automatically spread out to 31(-ish) columns width if entered into a cell like C10 on your Collections sheet.
Then you have two options, simply do =C8-C10 in C9, which you can drag with no problem. You can also hide the row 10 by making the text color white, or even integrate it in that sheet.
My recommendation however is not to do any of that, instead enter the formula
=arrayformula(C8:AG8 - split(substitute(join(";",Expenses!A2:DJ2),"Total:;",""),";")
into C9 on the Collections sheet and it's taken care of, without the need to drag it out. You might need to tweak it, not sure if the AG8 and DJ2 are the correct columns to end them on (should be the last column if every column or every 2 columns is a day). The arrayformula makes sure that the subtractions are done automatically for each pair of values, and expanded automatically into the row. Make sure that there are no values or formulas in D9:AG9, so it can fill up the values automatically and you don't get a #REF error.

Getting google sheets to stop changing formulas when pulling in responses

I have a sheet that is attached to a form on my website. It's using gravity forms for wordpress. Not sure what changed, but now every time a new submission comes in from the form it makes the formulas change on other sheets. I've done the $ signs in the formulas but it's still changing. The formulas are based off of the response sheet capturing all the answers.
How can I lock the formulas so they don't change every time a new response comes in? I want it always pulling from A2, even when new responses come in. I've seen the "Indirect" formula suggestion but my formulas are already complex. Here's one:
=ArrayFormula(vlookup(transpose(split(query(rept(row(Sheet1!$A$2:A)&" ",Sheet1!$B$2:B),,9^9)," ")),ArrayFormula({row(Sheet1!$A$2:A),Sheet1!$A$2:R}),{2,19},0))
This formula works perfectly, and once I change it all back to A2 after the first response comes in it works fine... but I make a new sheet with every form and I also reset the sheets when I turn forms on and off. I would like to not have to change it every time a first response comes in for every sheet. Any suggestions?
use in row 1:
={"header"; INDEX(IFNA(VLOOKUP(TRANSPOSE(SPLIT(
QUERY(REPT(ROW(Sheet1!A2:A)&"", Sheet1!B2:B),,9^9), " ")),
{ROW(Sheet1!A2:A), Sheet1!A2:R}, {2,19}, ))}
Form responses are always inserted in newly created rows that cannot be referenced directly in advance.
The usual recipe to work around this is to dynamically copy form responses to another sheet where the values can be referenced normally. To do this, choose Insert > New sheet and place this formula in cell A1 of the new sheet:
={ 'Form Responses 1'!A1:F }
...where F corresponds with the last form responses column that you want to copy.
Then modify your formulas to reference the new sheet instead of the form responses sheet.

Google Forms changes cell reference on different sheet in Google Sheets

I'm building a spreadsheet to track my macronutrients and calories. I made a google form for inputting information and it populates a "responses" sheet on google sheets. I made a different sheet within the same spreadsheet to perform all the calculation and generate graphs.
But every time I enter a new response into the form, it creates a new row and changes all the cell references in the calculations sheet. For example, I reference cell A2 from the responses
='Form Responses'!A2
and when I actually fill out the form and it populates, A2 in the responses sheet is filled in but the reference in my calculations sheet has been changed to A3.
='Form Responses'!A3
I tried using $ but it did the same thing, automatically changes the cell that I referenced.
Any way to have my calcuations sheet reference the newly created rows automatically?
In a new tab use for example, = {'Form Responses'! A: Z} and use this data to do your calculations and you will have no problems!
Solution
To avoid the row value to change reference when adding a new response, you will need to add the $ next to the number instead of next to the column value (A):
='Form Responses'!A$2
Moreover, an easy way to reference your whole column is to reference a range instead such as:
='Form Responses'!A:A
And then just drag it through your column. If you want it to be more specific (select the range you want):
='Form Responses'!A2:A999
I hope this has helped you. Let me know if you need anything else or if you did not understood something. :)

Google Sheets, Forms and Query for updating data to multiple sheets?

I am using a Google Form to collect data into a Google Sheet, I made another sheet and want to fetch data to this new sheet when a new form is submitted.
Used =QUERY('Form responses 1'!A228) to get data from the Form responses 1 sheet and it works good. I dragged the cell and the formula get copied correctly to the lower cells like =QUERY('Form responses 1'!A229) =QUERY('Form responses 1'!A230) and so on.
But now when a form is submitted nothing gets updated in the new sheet, I noticed the cell address has somehow skipped a place and when I do a new drag and drop from top column everything works fine. The cell references are copied correctly so that it should work on new form submit, but as soon a form is submitted the next row formula gets omitted, like the row got deleted in new sheet. i.e. After form submit if the current row formula is =QUERY('Form responses 1'!A228) and net row formula WAS =QUERY('Form responses 1'!A229) it gets changed to =QUERY('Form responses 1'!A330) and no row gets updated in the new sheet.
Try just ={'Form responses 1'!A228:A} . This is a formula that will bring in every cell from A228 to the bottom of the sheet. This way you do not have to keep dragging down formulas.

Resources