I have following formula
=UNIQUE(QUERY('Id match'!A2:B,"SELECT A,B WHERE B matches '"& TEXT(TEXTJOIN("|",1,FILTER(W3:W30,W3:W30<>"",W3:W30<>0)),0)&"' ",0))
That is Querying results if the item is contained in a list. So far so good. This function needs to constantly evaluate the input from Cell W3:W30. However as soon as I close the sheet, this continuation seems to stop & the Formula returns to the result "#N/A". Repasting the formula does the trick but I dont want to do this over and over.
It is worth mentioning that the query input is based on another query!
I read that SpreadsheetApp.flush() in an Apps Script might help, but for me it does not. Also I am a bit confused how I tell the script which spreadsheet to update.
Has anyone an idea to approach this issue and keep the formula working at all times
Related
Hello everybody and thanks a lot for your help.
Here's my problem:
What I have:
I have a table with raw data in 53 rows and numerous columns which I would like to reduce and restructure into three columns: City, Date and Value.
https://docs.google.com/spreadsheets/d/1bsdC8lrtSGk957ae8Z0VRGnDqTZfFLPpLkfoid0UbIQ/edit?usp=sharing
What I've done so far:
For a single row, I used the following formula to make everything work as I wanted it to:
ArrayFormula({SPLIT(TRANSPOSE(Base_Data!A2)&"|"&TRANSPOSE(Base_Data!AJ1:1&"|"&Base_Data!AJ2:2),"|")})
What I want:
I'd like to extend the formula to work for the entire area, all 53 rows. Does anyone have a tip for this? The solution doesn't have to be a formula, it would work as a script, too
I've set up a new sheet called "New_Data [Erik]" and placed the following formula into A2:
=ArrayFormula(SPLIT(FLATTEN(Base_Data!A2:A&"\"&Base_Data!AJ1:1&"\"&Base_Data!AJ2:54),"\",0,1))
If this is a one-time conversion, I'd recommend copying the results in place. To do that, select A:C, hit Ctrl-C to Copy and then Ctrl-Alt-V to Paste Special. A small clipboard icon will appear. Click it and choose "Paste Values Only."
If you'll need this functionality ongoing, just understand that FLATTEN is a not-yet-official function of Google Sheets, which means that while Google sheets may very well make it official, they may also decide to do away with it at any time. (This is why I suggest copying and pasting the results in place, if it's just a one-time conversion.)
Not sure what you're trying to get to there. If you are trying to leave out all columns but 3, just do ={Base_Data!A2:A, Base_Data!E2:E} and add as many columns as you require comma-separated within the curly brackets
I've got a sheet that imports a number to a cell (A2) via ImportXML. This value is always changing. Is there a script I can run that will, in another cell, track the highest realized value of A2, until a certain date, in B2?
Is this possible in Google Sheets?
If you shared the code that you have it would be way easier to help you. Since I don't know your implementation I can only suggest pseudocode for you to try, but I (or anyone) can't tailor it to your case.
But basically you just need something like the code bellow just after you update the value of A2
if(a2<b2){
b2=a2;
}
In Google Sheets, I have a formula in a cell that connects to an API with a script and spits out the JSON results. For example, I can connect to the Youtube API with a formula that looks like this,
=ImportJSON("https://www.googleapis.com/youtube/v3/videos?id=mv-cj6mBkPk&key=API KEY&fields=items(id,snippet(channelId,title,categoryId),statistics)&part=snippet,statistics")
I'd like to make part of that formula get it's value from a separate cell. For example, the video ID above (mv-cj6mBkPk), rather than have it typed in the above formula, I'd like to pull in the value from a cell (i.e. B1). Then I can create multiple versions of this formula with other video IDs (i.e B2, B3, etc.)
I've tried combining various parts of the formula through CONCATENATE-ing a few cells, but that doesn't seem to 'RUN' the formula, it just shows it.
My skills aren't so advanced in this area, so any help would be great. Thanks!!
It is not obvious what your problem is exactly, or where you got the code for the ImportJSON() function (as this is not a built-in function),
but a variation of the below SHOULD work - if it does not, then post what error you are getting (exactly).
Also, I presume you have substituted "API KEY" for the actual key... I have used API_KEY, so that the formula does not get broken across multiple lines here.
A1 : mv-cj6mBkPk
A2 : =ImportJSON("https://www.googleapis.com/youtube/v3/videos?id="&A1&"&key=API_KEY&fields=items(id,snippet(channelId,title,categoryId),statistics)&part=snippet,statistics")
INDIRECT() seemed easy for tiny formulas but it didnt seem that easy for the below formula. The reason I want to freeze is whenever I delete the rows in FormResponses, the formula in the second tab is going haywire.
So watevr happens in FormResponses, I want the formula to be rock steady.
=SUM(ArrayFormula(('Form Responses 1'!$B$2:$B=A2)*('Form Responses 1'!$A$2:$A)*(if(offset('Form Responses 1'!$B$2:$B,0,1)="Break Start", -1, 1))))
SAMPLE SHEET _ TAKE COPY
Unfortunately there is no way to lock just the formatting of a sheet or range. If they are locked it will prevent everything from being changed. Best bet for this would be to create a copy of the sheet, format it how you would like, and protect it from everybody.
Then there are a couple of options:
Go to the protected sheet, select all of the cells, and use format painter to copy the format to the working sheet.
Write a script to copy the format of the protected sheet to the working sheet.
Another option would be to write a script to set the format of sheet. This can be setup to happen when the sheet is opened, edited or when you manually run the script.
Or
To keep some of your data in the same place, you can freeze rows and columns:
Open a spreadsheet and select a cell in a row or column you want to freeze .
Open the View menu.
Hover over Freeze.
Select one of the options to freeze up to ten rows, or five columns. You can also choose Up to current row (or Up to current column) to freeze the rows or columns before a cell you've highlighted.
I need cell B3 to reference B1 while blank.
Once you put something in B1 it'll keep that value forever, even once B1 get's changed to something else.
This is my situation:
Basically I have a sheet that is fed by a Google form and each submission needs three key reference numbers each kept in columns a,b,c
A = Unit Number/Individuals name (There may be duplicates down the sheet as this is per submission)
B = Work Order (Imputed by me after actual work on unit has been done)
C = Cry Number/Reference number (Automatically generated per submission; no duplicates)
I then have a frozen row at the top which contains a search bar that you can search for the cry number (A1)(Which has a Data Validation set to column C so that you can only search valid cry numbers) and then a cell to add a W/O to that Cry Number (B1)
In column B3:1000, I have this formula copied down:
B3=if(isblank($C3),"",if($A$1=$C3, SUBSTITUTE($B$1,"",$B$1),""))
...which makes it so that if you select say "CN-168" (A valid cry number) and in 'B1' type "W1134" that work order number will be assigned.
Now I need that work order to stay there regardless of when 'A1' changes so that you can do the process over again on another submission.
Is it possible to do with formulas? If not, then a Google Script?
Here is a template of what I'm dealing with but not to the same scale as my Data Base
Its not possible with formulas but easily done with apps script. look at the onEdit trigger and the documentation for SpreadsheetApp to setValues to the appropiate ranges.
If you want to be 100% complete you also need a time trigger (say every 10 minutes) to check that a row wasnt missed. It can be missed during apps script errors/outages or when the sheet is changed from outside the sheets webpage/app (For example using the http spreadsheet api)