google-sheets

REGEXEXTRACT with capturing group

柔情痞子 提交于 2021-02-16 16:41:27
问题 I wonder if there is a way to refer to the group captured in same expression when using REGEXEXTRACT() in Google Sheets? Let's say we have a sample string: aaa123bbb123ccc456ddd123eee123fff456ggg and we'd like to extract the part where some 3 digits occure at least 3 times. Normally I would use regex like this: (\d{3})(?:[^\1]*\1){2,} but how to refer to the first group in =REGEXEXTRACT(A1;"(\d{3})(?:[^\1]*\1){2,}") ? This one returns error in Sheets. 回答1: There is no backreference support in

Splitting a cell containing a list of text values into other cells, depending on the values in the list

安稳与你 提交于 2021-02-16 15:33:12
问题 I'm wondering whether it's possible to split a cell that contains a comma-separated list into various columns, based on a reference table that is editable, using only Google Sheets formulae and not resorting to Apps Script. I have created a simplified version to better explain what I'm trying to achieve. I am presented with a table like this: In A2 there is a list of colour names, and I would like them to be sorted into the correct columns in new, smaller lists. The ideal solution would look

Can I use scripts alongside or in reference to an Add-on's functions in Google Sheet?

不打扰是莪最后的温柔 提交于 2021-02-15 07:54:58
问题 I've created a Google Sheet in which I am using the Autocrat Add-on. I've created a script that takes further actions that I would like to triggered by onFormSubmit(). What I notice is that if I run the script in the Script Editor, it executes fine and takes the actions on the spreadsheet that I want it to successfully. When I submit a new entry on the form, however, it doesn't run the script - regardless of whether Autocrat is configured to take action onFormSubmit() or not. (This

find this error in my code TypeError: Cannot read property 'getLastRow' of null (line 5, file “Code”)

点点圈 提交于 2021-02-15 07:48:08
问题 function prices() { var scraperSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("prices") var lrow = scraperSheet.getLastRow(); for (var i=2;i<=lrow;i++) { var regEx = /<span id="priceblock_dealprice.*<\/span>/gi var getContent = UrlFetchApp.fetch("https://www.amazon.in/"+scraperSheet.getRange(i,1).getValue()).getContentText().trim(); var price = getContent.match(regEx) price = price[0]; price = price.replace('<span id="priceblock_dealprice" class="a-size-medium a-color-price

Google script - using template to build table

匆匆过客 提交于 2021-02-15 07:44:29
问题 Trying to build a report to be sent via email. My idea was to build the email using an HTML template, but I seem to be missing out on something... The email should contain a report which will include all entries with a specific month in ColB. Here's a quick demo sheet Here's my code function MonthlyPulseCheck() { var spreadsheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet1'); var pulsedate = new Date("02/02/2022"); var pulsemonth = pulsedate.getMonth(); var Pulsetable =

Google script - using template to build table

一笑奈何 提交于 2021-02-15 07:44:00
问题 Trying to build a report to be sent via email. My idea was to build the email using an HTML template, but I seem to be missing out on something... The email should contain a report which will include all entries with a specific month in ColB. Here's a quick demo sheet Here's my code function MonthlyPulseCheck() { var spreadsheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet1'); var pulsedate = new Date("02/02/2022"); var pulsemonth = pulsedate.getMonth(); var Pulsetable =

Hiding worksheets from specific users inside a spreadsheet

白昼怎懂夜的黑 提交于 2021-02-13 17:32:20
问题 Sorry I'm not familiar with coding, I have a spreadsheet with multiple worksheets, it's shared with many people, I'm trying to make those sheets hidden by defaults when it's shared with a new person, and define some users as an admin users, and user groups for each location, I could run the code, and it worked when it was shorter, I know there might be easiest ways, however do you beilive there is a speific reason I'm getting nothing running the code, and users still see the hidden sheets

Google Sheets - Run script with Sheet Protection

陌路散爱 提交于 2021-02-13 17:31:35
问题 I'm having an issue with my google sheet. Everything works fine on the owner view, but when I tried to share it to an editor, some function didn't go as I planned. As an owner, I use the protected sheets and ranges function. So, I used the protect sheet, then the except certain cells function so that editors can edit within that range. I put a two buttons to hide (for the rows that is empty) and show rows. The script is working fine since it worked on the owner view, but when I opened it to

For Loops timing out: JavaScript / Google Apps Script

放肆的年华 提交于 2021-02-13 17:27:26
问题 So I am have this issue with Google Apps Script. It is timing out because the app server requests are taking too long. I was just wanting to see if my coding could be cleaned up a bit to run faster or is there another method which would work? Code below: for (var y = 1; y < listLast ; y++) { var matchor = listSheet.getRange("B" + y).getValue(); var listEmCo = listSheet.getRange("A" + y).getValue(); if(matchor == "Match") { Logger.log("Do Nothing"); } else { for (var x = 0; x < formLast; x++)

For Loops timing out: JavaScript / Google Apps Script

青春壹個敷衍的年華 提交于 2021-02-13 17:26:50
问题 So I am have this issue with Google Apps Script. It is timing out because the app server requests are taking too long. I was just wanting to see if my coding could be cleaned up a bit to run faster or is there another method which would work? Code below: for (var y = 1; y < listLast ; y++) { var matchor = listSheet.getRange("B" + y).getValue(); var listEmCo = listSheet.getRange("A" + y).getValue(); if(matchor == "Match") { Logger.log("Do Nothing"); } else { for (var x = 0; x < formLast; x++)