google-sheets-query

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

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

Array Formula with AverageIF of a row

大兔子大兔子 提交于 2021-01-29 08:35:44
问题 I have a formula in a Google Sheet that is averaging the values in a row... =AVERAGEIF(A2:L2,"<>0") Simple, right? However, I cannot figure out how to get the ARRAYFORMULA to work for this. =ARRAYFORMULA(AVERAGEIF(A2:L,"<>0") That formula only averages all of the cells in the range, instead of returning the average for each row. What am I missing? 回答1: you were close. try: =ARRAYFORMULA(QUERY(TRANSPOSE(QUERY(TRANSPOSE(A2:L), "select "&TEXTJOIN(",", 1, IF(LEN(A2:A), "avg(Col"&ROW(A2:A)-ROW(A2)

Is there a better way to replicate a column array n times in Google Sheets

杀马特。学长 韩版系。学妹 提交于 2021-01-28 19:02:35
问题 I need to formulaic solution to copy a column range stacking on top of itself a given number of times. I found one ugly solution by incorporating a sequence function (to get 1,2,3...n) into an arrayformula for a text operation (Left). The Left operation does nothing but return the original value, but gives me the opportunity to include the sequence array. There must be a better way to do this. Problem : Write a formula that creates a column where a named column range is stacked on top of each

Google Sheets - Import Range within a Query

浪尽此生 提交于 2021-01-28 17:37:44
问题 Trying to run a query with an import range function built into it, but I keep getting an ERROR message. Here is the formula I am trying to use: =QUERY(IMPORTRANGE("1BJ11UiLyiK3PaS2iwHEsyuMMXomdvrEkYYj_Z7bWWw4","Sheet1!A:C"),"Select Col2 where Col1 = '"A1"' ") I've tested the import range formula without the query and that goes through successfully so it must be something with how I am writing the query. 回答1: You just need to add ampersands (&). Try this: =QUERY(IMPORTRANGE(

Google Sheets - Import Range within a Query

拟墨画扇 提交于 2021-01-28 17:36:28
问题 Trying to run a query with an import range function built into it, but I keep getting an ERROR message. Here is the formula I am trying to use: =QUERY(IMPORTRANGE("1BJ11UiLyiK3PaS2iwHEsyuMMXomdvrEkYYj_Z7bWWw4","Sheet1!A:C"),"Select Col2 where Col1 = '"A1"' ") I've tested the import range formula without the query and that goes through successfully so it must be something with how I am writing the query. 回答1: You just need to add ampersands (&). Try this: =QUERY(IMPORTRANGE(

Join four columns into one according to each row

北战南征 提交于 2021-01-28 11:29:16
问题 A B C D E F G H I J K L M N O P If I chose to join the columns I would ={A1:A;B1:B;C1:C;D1:D} but it would look like this: A E I M B F J N ... and so on I would like it to look like this: A B C D E F G ... and so on How to proceed in this case? Note: It may happen that some of the columns are not complete in data, some may have more values than the others, but I still want to continue following this same pattern. Example: A B D E G H I J K L M N O P Result: A B D E G H ... and so on 回答1: use:

How to use a SQL query in Google Sheets to group by a substring

安稳与你 提交于 2021-01-21 10:42:41
问题 In my table, in Google Sheets, I have a column B called "description" and I'm trying to write a SQL query to group by substrings of column B. Values in B are like "Sell 1 Jan11 300.0/307.5 Strangle" and I just want to group by 'Jan11'. I have a few rows with Jan11 then it switches to Jan18, etc. I've tried substring, char index, mid, and nothing is working I've tried: =QUERY('spgsh1378'!A1:AP,"select B, mid(B,7,5), sum(M) group by mid(B,7,5)" =QUERY('spgsh1378'!A1:AP,"select B, substring(B,7

How to use a SQL query in Google Sheets to group by a substring

六月ゝ 毕业季﹏ 提交于 2021-01-21 10:41:09
问题 In my table, in Google Sheets, I have a column B called "description" and I'm trying to write a SQL query to group by substrings of column B. Values in B are like "Sell 1 Jan11 300.0/307.5 Strangle" and I just want to group by 'Jan11'. I have a few rows with Jan11 then it switches to Jan18, etc. I've tried substring, char index, mid, and nothing is working I've tried: =QUERY('spgsh1378'!A1:AP,"select B, mid(B,7,5), sum(M) group by mid(B,7,5)" =QUERY('spgsh1378'!A1:AP,"select B, substring(B,7