I've been searching for a solution for a while and have not been able to get one. I am new to Google apps script and appreciate any help with this newbie question.
Here is what I have:
spreadsheet.getRangeList(['I5', 'I10', 'I15', 'I20']).setFormula('=SUMIFS(Sheet1!$EZ:$EZ,Sheet1!$BV:$BV,"Criteria",Sheet 1!$L:$L,$A5)');
The problem is it will paste that formula to each of the cells without changing the $A5 to $A10, $A15 and $A20, respectively.
Is it possible to do what I am asking?
Instead of using setFormula use setFormulaR1C1
Related
How do I add formulas to Google Spreadsheet using Google Apps Script?
Related
I'm using a GOOGLEFINANCE formula, but it keeps updating. I would like it to stay a fixed amount once it has been calculated the first time but I can't seem to figure out a way to do that. I tried Googling for the answer but came up empty-handed. I went to File > Spreadsheet Settings > Calculation, but there doesn't seem to be an option there to prevent recalculations, there only exist options to delay them.
It seems that feature is not built into Google Sheets. But maybe someone who is really good at formulas or a script. Can think of a super smart way to do it with a formula or a script?
There is no way to stop a Google Sheets formula, including those that use GOOGLEFINANCE function to recalculate.
You might replace the formula by it's result. One simple way to do this is by doing copy-paste as value only.
P.S. GOOGLEFINANCE data can't be retrieved by Google Apps Script.
Related
Pulling current price change % (Google Finance) with Google Apps Script
I have a google sheets which is linked to a form and a google scripts that was created in the menu of google sheets. This script runs fine and I use it to format the data. However, I have another script which I created from the google developer console, which sends and receives data from a website. I need this second script to get the value of a cell in the google sheets.
How can I link this second form to the google sheets while keeping the script already linked to the sheets?
When looking at responses to other questions they seem to be about individual sheets in a set so just to clarify, when referring to google sheets I mean the whole google sheets document. I only have one sheet anyways.
If it helps: The script I want to add acts a bit like a server and is being deployed by google scripts while the script that is already linked is only run when I call it on the sheets.
There is not way of attaching a standalone script to a document making it a bound script (which is the actual terminology for the script linked the the document).
The simplest way would be to copy-paste the code to the other script. You can deploy the bounded script.
If you really need more than one project for whatever reason, you can enable the Apps Script API and use projects.create (read reference) to create another one. If you don't know what this means, you probably shouldn't use it as it's finicky at best.
I found a solution which was to link the script to the google sheets using
var ss = SpreadsheetApp.openById("SHEET_ID_HERE");
I can then use ss.getActiveSheet().getRange().getValue();
and other funtions.
Thanks for the help!
Simply, I have created a chart by inserting a chart and adding range/settings etc.
But I have realised that when resizing the chart (by recording a macro) all the settings are lost.
Is there a way to convert the Google Sheets Chart into Google Apps Script, otherwise I think I will have to re-create the graph in Google Apps Script. Just hoping to save some time with this query.
Thank you in advance.
I understood that you want to create a graph in Apps Script in a similar way that you did in a Sheet. If I understood it right, then you can complete your aim by using Charts Service. You can see a full example in the linked documentation.
Just to clarify it, first you would need to create a table using DataTableBuilder. This table should be equal to the one in your Sheet. After that you can create a graph based on that table. Please, ask me any question if you still have doubts.
Is there a FORMULA that will display the name of the file in a cell?
I've found scripts that will do it, formulas that will display the sheet name, but no luck finding a formula that will show the filename.
If I have to resort to the script, so be it. But I'd like to use formula if possible.
If this has been asked before, please point me to the post and I will delete this one.
I'm in the process of automating one of my weekly reports - however part of this process involves the merging of cells and unmerging - currently unmerging is done seperatly however im just wondering if such a method exists to find cells that are merged and unmerge them?
Many thanks.
My answer to this question will be "clear formatting" Option in Format menu.
GAS has a method to unmerge cells but unfortunately there is no way to know which cells are merged.
Some users have suggested a few workarounds, the one I prefer is described in this post: Split (break apart) merged table cells in google spreadsheet with an apps script
There is also an enhancement request and interesting suggestions mentioned in this post: How do I know if spreadsheet cells are merged using google apps script
Paste the data in Excel , unmerge all the cells and past it back in google sheets , confirm by wrapping the text in the column where there were Merged cells.
simple
copy from google sheets
Paste in Excel
unmerge all the cells in Excel
paste in google sheets .