google-sheets-formula

Google Sheets search value and return certain columns of multiple rows where the value is present

你说的曾经没有我的故事 提交于 2021-02-08 06:45:29
问题 I'm looking for a formula which can do the following: Lookup a value in column E:I and return all the values from column B:D from the rows it is present. Example: Looking for S190202 , it would return B:D from row 2,5,6 回答1: =QUERY(A1:I, "select B,C,D where E='S190202' or F='S190202' or G='S190202' or H='S190202' or I='S190202'", 1) for a cell reference, you can change it to: =QUERY(A1:I, "select B,C,D where E matches '"&K2&"' or F matches '"&K2&"' or G matches '"&K2&"' or H matches '"&K2&"'

Using IMPORTRANGE, INDIRECT, and CONCATENATE together

╄→гoц情女王★ 提交于 2021-02-08 06:35:35
问题 I have a sheet that pulls numbers from several different sheets to amalgamate numbers. Each week, a new sheet is added to the source files, all with the same name. I'd like to update the amalgamated sheet by changing one cell instead of many. When the tab is located in the same Google sheet, this is easily done with INDIRECT. Right now, the formula in the amalgamated sheet is: =IMPORTRANGE(M4, "Aug29!$F$2") That formula is on each line to pull from several different sheets: =IMPORTRANGE(M5,

Google Apps Script in Google Sheet - Convert formulas to static values - cell function to value

假装没事ソ 提交于 2021-02-08 04:44:23
问题 Is there a Google Apps Script method that will change a cell with a formula to one with a static value? The reason for this is to avoid lag in the Sheet from lots of cell formulas recalculating as the sheet becomes larger. I want to make the sheet replace old formulas with static values since they won't be changing. 回答1: Use the copyValuesToRange() method: function copyFormulasToValues() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sourceSheet = ss.getSheetByName("Sheet1"); var

Google Script version of VLookup (More Efficient Method?)

喜夏-厌秋 提交于 2021-02-05 12:24:55
问题 I'm trying to put together a function that will allow me to pull a column's info from one sheet to another based on a key column. This would work similar to an index match or vlookup in excel/google. Sample Data: What I've tried: function vlookup(importFromSht, importToSht, importFromCompCol, importToCompCol,importFromCol, importToCol){ var lastImportFromRN = importFromSht.getLastRow(); var lastImportToRN = importToSht.getLastRow(); var importFromCompArr = importFromSht.getRange(2,

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&"

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