How Can I Set a Formula to Only Update Once - google-sheets

I'm collecting Google Form responses in a sheet, and merging over a variable to keep track of who in my roster has responded.
My issue is I'm having to bring the Form responses into the current sheet with IMPORTRANGE, and everyone once and a while, that formula inexplicably returns
"#REF! Import Range Internal Error"
for up to a few hours before correcting itself. This means my completion tracking isn't working at that time.
Is there a way to set a simple function like =A2 to only update when text is added, and not if it disappears?
I want a sheet to contain the data in the imported range and add to it as more form responses come in, but also keep all the data if the imported range disappears.

just put your IMPORTRANGE formula into IFERROR eg:
=IFERROR(IMPORTRANGE("ID", "Sheet1:A1:B"))
this way you will get either values you need or nothing till #REF! disappears.

Related

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 Sheets - Vlookup not updating formulas automatically when new sheet reference is created [duplicate]

I have this formula in a cell in a 'Summary' sheet which is waiting for a new sheet to be created with its name being a date:
=IFERROR(VLOOKUP($A3, INDIRECT("'"&TEXT(BN$2,"m/d/yyyy")&"'!$E$6:$o$100"), 11, false), "")
However, when I add the new sheet with the name that would match, then it doesn't automatically recalculate and pull in the values from the new sheet.
The weird thing is if I add a column to the left of this column that has the formula shown above, then it recalculates ... and all is well. Another weird thing is if I add a column far enough away from the column in question then it doesn't recalculate in the same way that it does when I add a column near the column in question (hmmmm....).
What is going on here? And how can I work around it? Seems Google has some major bugs around this area or something ...
This is due to INDIRECT.
A partial workaround:
=IFERROR(INDIRECT("'"&C9&"'!A1"),RAND())
Use this instead of just INDIRECT in your formula. It still won't update on opening and closing. But it'll update, Whenever there's a edit anywhere in the sheet (making this a double volatile combo with RAND()).
Also, Try turning on recalculations every 6 hours or so in spreadsheet settings.
PS: Your Spreadsheet might burn🔥🔥 due to the heavy volatility.
Sorry for the late response, but I believe I have a solution that works a little better. I was experiencing the same problem with formulas involving almost exactly the same set of formulas.
Basically, just add in a check to see if now() equals an impossible time (0), and when it fails (every time), have it execute the formula that won't update on its own.
=IF(NOW()=0,"",
IFERROR(VLOOKUP($A3, INDIRECT("'"&TEXT(BN$2,"m/d/yyyy")&"'!$E$6:$o$100"), 11, false), "")
)
based on idea similar to TheMaster I defined a named range refresh and refered to it in the else portion of the IFERROR formula.
Whenever I create a new sheet, rename an existing one, or feel the need to make sure all indirects are updated I simply edit the content of refresh, and put it back to blank.
=arrayformula(iferror(indirect(B11&"!D42:H42");refresh))
I used Berteh's idea, but found that putting the refresh range within the else portion of the iferror removed the benefit of having a way to have a blank cell if there is no value, or what ever else you'd want to use the else for.
So, to maintain that, I put this together which seems gets us the benefit of preserving the benefit of using iferror and forcing the indirect to update.
=IF(refresh!$A$1=1,IFERROR(VLOOKUP($B68,INDIRECT(D$66&"A1:aa2000"),8,0),""))
Updating the value of the refresh range will force a recalculation (I change the value of cell A1 from 1 to a 0 and then back to 1). I've implemented this on multiple rows across multiple sheets and not found this to blow up the Google Sheet.

"Unresolved Sheet Name" errors randomly shown across my cells

This started happening to me today, almost randomly my functions show "Unresolved Sheet Name". I have to go into the function, as if I was editing it, and just hit Enter and it works like normal. The issues is I have thousands of functions across several sheets and they keep intermittently "breaking" on their own terms.
This is similar to: Google Spreadsheet Import Range #REF! Error (Randomly).
I have a spreadsheet holding a large chunk of data which I import to the current spreadsheet I'm using. I then reference the worksheet I used to importrange the data into. The reference to that worksheet will intermittently break.
I see no reason to paste my functions, since they do work as long as this #REF error does not show up.
Is this a known bug?
I've had this happen before in the past, and eventually resolved to just "refresh" all my functions every time this happened. In this case, the spreadsheets are client facing and need to be reliable so I don't have that option.
Any way to "refresh" all my functions without going through them one at a time?
I had a similar issue that I corrected with script. My spreadsheet references sheets that aren't yet created. This results in a "ref" error as expected. However, when I create the sheet, the "ref" error only goes away when I click in the cell and then hit "enter."
Since I had already written a script to update my sheet monthly, I added the following to the end (I only needed to update 12 cells, hence the range):
var ss = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Random Notes/Calcs");
var formies = ss.getRange(31, 24, 12, 1).getFormulas();
ss.getRange(31, 24, 12, 1).setFormulas(formies);
In summary, get your range, then get the formulas, and then set the formulas to the same range. I'm sure there is a better way. Hope this helps.
I have some time working with google sheets, the issue I've have is in the Import Range #REF! Error (Randomly)
Fine, the solution I found is using the ** RANDBETWEEN** and MOD
Try this
=IF(MOD(RANDBETWEEN(0,10),2)=0,IMPORTRANGE("SheetID","Sheet!a:Ab"),IMPORTRANGE("SheetID","Sheet!A:Ab"))
With the Changes, the rand formula will recalculate the number. If you see, the Range of the sheet change A by a.

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

Google spreadsheet CTRL+Shift+E

I have spreadsheet with two sheets: current_sheet and archive_sheet.
I also have a script (which I created) which removes data from current_sheet and appends it to archive_sheet once per month.
The sheets have an arrayFormula, and after every monthly move operation, cells with this arrayFormula wind up without any results - and I receive a warning message, indicating that I should press Ctrl+Shift+E in order to resolve the problem.
Once I've done so - the formulas work again. What I'm wondering is... how can I alter my script so that I don't have to provide this manual fix every month?
use a time driven trigger to run your script each month
Instead of using script to move your data each month, try copying the values, then clearing the original data and reinitialise the formula. Without seeing your formula and have a clear understanding of what your doing, im kinda punching in the dark.

Resources