google-sheets

How to display a personalized message when I use a query-importrange in Sheets

血红的双手。 提交于 2021-02-05 08:18:12
问题 I'm using a query function with importrange but I need a personalized message when query couldn't find anything in the database. Currently I'm using this formula. =QUERY( { IMPORTRANGE("url", "'Parte 1'!A1:AH"); IMPORTRANGE("url", "'Parte 2'!A1:AH"); IMPORTRANGE("url", "'Parte 3'!A1:AH"); IMPORTRANGE("url", "'Parte 4'!A1:AH") }, "Select Col2, Col1, Col34, Col24, Col3, Col4, Col5, Col6, Col11, Col7, Col8, Col9, Col10, Col12, Col13, Col14, Col15, Col20, Col21, Col22, Col23 Where Col10="&$C$1&"

Transform one to many data to columns

狂风中的少年 提交于 2021-02-05 08:10:52
问题 Given this data: How do I transform it to look like this: There are two columns in the data source, key ( title ) and value ( responsibility ). I need to transform it such that we have the key column ( title ) and then n columns where n is the highest number of value a key has, eg 3 in the picture above. Hence the columns should be: Title, 1, 2, 3 . The values in each column 1, 2, 3 should be corresponding to values in the original data. Any combination of formula is welcomed - I believe a

Google Sheets: Custom function with dynamic change

筅森魡賤 提交于 2021-02-05 08:09:20
问题 I am using a custom function that keeps track of what color a cell is. But there is a problem in that this function does not update itself if the cell color changes. Cell color: function GetCellColorCode(input) { var ss = SpreadsheetApp.getActiveSpreadsheet(); var cell = ss.getRange(input); var result = cell.getBackground(); return result } Next, I found and add a script that recalculates all the formulas in the table so that they update themselves. I added trigger so that this formula runs

Extracting multiple values with RegEx in a Google Sheet formula

谁说胖子不能爱 提交于 2021-02-05 07:54:29
问题 I have a Google spreadsheet with 2 columns. Each cell of the first one contains JSON data, like this: { "name":"Love", "age":56 }, { "name":"You", "age":42 } Then I want a second column that would, using a formula, extract every value of name and string it like this: Love,You Right now I am using this formula: =REGEXEXTRACT(A1, CONCATENER(CHAR(34),"name",CHAR(34),":",CHAR(34),"([^",CHAR(34),"]+)",CHAR(34),",")) The RegEx expresion being "name":"([^"]+)", The problem being that it currently

Extracting multiple values with RegEx in a Google Sheet formula

大憨熊 提交于 2021-02-05 07:53:07
问题 I have a Google spreadsheet with 2 columns. Each cell of the first one contains JSON data, like this: { "name":"Love", "age":56 }, { "name":"You", "age":42 } Then I want a second column that would, using a formula, extract every value of name and string it like this: Love,You Right now I am using this formula: =REGEXEXTRACT(A1, CONCATENER(CHAR(34),"name",CHAR(34),":",CHAR(34),"([^",CHAR(34),"]+)",CHAR(34),",")) The RegEx expresion being "name":"([^"]+)", The problem being that it currently

Comma separated list into matched columns pairings

 ̄綄美尐妖づ 提交于 2021-02-05 07:45:10
问题 I thought I was a decent Sheets jockey, but here's a toughie. I'd like to turn the left into the right using just a formula Sample also at: https://docs.google.com/spreadsheets/d/1JgDZOV_K7SbOrCb27Z5K2XUBcrtq99GTCa3-BM2pOD0 The closest I found was this (Separating Comma List into Cells with Formula) but it doesn't also do the matching. 回答1: alternative by @Matt:King: =ARRAYFORMULA(QUERY(VLOOKUP(SEQUENCE(COUNTA(A2:A)* COLUMNS(SPLIT(B2:B, ",")), 1, 0)/ COLUMNS(SPLIT(B2:B, ","))+2, {ROW(A:A), A

Google sheet QUERY + MATCHES function doesn't exclude strings

我只是一个虾纸丫 提交于 2021-02-05 07:44:41
问题 I would like to import rows from a sheet that exclude certains character. I did it first using the CONTAINS function but i didn't find a way to do it with multiple parameters. So i did it using the MATCHES function : =Query(importrange("URL";"Sheet!a:be");"SELECT Col1, Col3, Col4, Col26, Col8, Col30, Col40, Col41, Col44, Col45, Col49 WHERE NOT Col8 MATCHES '.*alc.*|.*vin.*|.*alcool.*'") however there is still rows where those strings appear in Col8, i don't know why ? How could i do it in

Event object of onSubmit is empty in Google script

匆匆过客 提交于 2021-02-05 07:43:19
问题 I have a Google form linked to a Google sheet. In that spreadsheet I have code that have this function onSubmit(e){ Logger.log(e) Logger.log("Call onSubmit") } The trigger is setup as follow Project: Spreadsheet's scritp Deployment:Head Event:From spreadsheet - On form submit Function:onSubmit So whenever I submit the form, the log shows [object Object] Call onSubmit The form has many questions, not an empty form. As I read the documentation, it seems like the event object has many

Google Sheets Formula: Sum if Substring in range of cells

∥☆過路亽.° 提交于 2021-02-05 06:37:06
问题 I have two columns: Col A Col B 01.02.2020 17 03.11.2020 24 03.11.2020 12 I tried to sum Col B, based on the substring of Col A like so: =SUMIF(A:A,MID(A:A,4,2)="02",B:B) =SUMIF(A:A,MID(A:A,4,2)="11",B:B) Which means: If it's the second (XX.02.XXXX) month, it should sum the values from Col B based on that. If it's the 11th month (XX.11.XXXX) in Col A, it should do the same but for cells where Col A has 11. However, it doesn't work. Apparently, one cannot do the MID function over more than one

OnEdit Not Triggering With Copy & Paste in Google App Script

China☆狼群 提交于 2021-02-05 06:15:47
问题 I have a script that adds the current date when column one is edited, but at the moment it doesn't work when a value is pasted in . Is it possible to make this script add the date for each row of the range that is pasted into column 1? function onEdit(e) { if (e.range.getSheet().getSheetName() == 'Add Statements Here' && e.range.getColumn() == 1) { e.range.offset(0,10).setValue(e.value.length>0 ? new Date() : ''); } } 回答1: When pasting onto the cell, the "value" property of the event object