google-sheets-query

A way to maintain cell references when doing dynamic running total

不打扰是莪最后的温柔 提交于 2021-01-05 10:57:40
问题 I have a running total of another dynamically generated column (I7:I). I computed it using mmult() . The only problem with this is using indirect means the references break if I move data around in my sheet say by adding or removing rows above 7. If I use I7:I as my reference, it says the resulting array is too large. Is there a better way of doing this? =ArrayFormula( MMULT(TRANSPOSE((ROW(indirect("I7:I" & max(ArrayFormula(ROW(I6:I)*(I6:I <> "")))) )<=TRANSPOSE(ROW(indirect("I7:I" & max

Reduce a number down to a static set of numbers

天大地大妈咪最大 提交于 2021-01-05 06:53:26
问题 Okay, so I have a Google Sheet that I need to reduce a number down to a specific set of 4 numbers. Then count how many times those numbers occur. For example: The numbers it breaks down to: 1, 2, 3, 4 Disregard their individual values other than for the purpose of being broken down. Now take the number 17 . Count+Add 1, 2, 3, 4, 1, 2, 3 = 7 r1 Take number 12 Count+Add 1, 2, 3, 4, 1 = r1 The remainder is rounded DOWN So, basically, it breaks down Cell A1 into a count of how many sequences it

Reduce a number down to a static set of numbers

烂漫一生 提交于 2021-01-05 06:52:02
问题 Okay, so I have a Google Sheet that I need to reduce a number down to a specific set of 4 numbers. Then count how many times those numbers occur. For example: The numbers it breaks down to: 1, 2, 3, 4 Disregard their individual values other than for the purpose of being broken down. Now take the number 17 . Count+Add 1, 2, 3, 4, 1, 2, 3 = 7 r1 Take number 12 Count+Add 1, 2, 3, 4, 1 = r1 The remainder is rounded DOWN So, basically, it breaks down Cell A1 into a count of how many sequences it

Google Sheets query - Multiple “where” conditions with “group by” and “order by”

China☆狼群 提交于 2020-12-13 05:50:37
问题 I'm trying to use multiple where conditions (2 conditions) with 'group by' and 'order by' statements inside a Google Sheets Query formula. query(Sites!A:D,"select A,C,sum(D) where B contains 'Google' and sum(D) > 100 group by A,C Order by sum(D) desc label sum(D) 'Total Impressions'") Above is the formula I tried, but it gives me an error with #VALUE! Is it an issue with the order of statements? 回答1: Aggregation functions can be used in select, order by, label, format clauses. They cannot

Google Sheets query - Multiple “where” conditions with “group by” and “order by”

◇◆丶佛笑我妖孽 提交于 2020-12-13 05:50:00
问题 I'm trying to use multiple where conditions (2 conditions) with 'group by' and 'order by' statements inside a Google Sheets Query formula. query(Sites!A:D,"select A,C,sum(D) where B contains 'Google' and sum(D) > 100 group by A,C Order by sum(D) desc label sum(D) 'Total Impressions'") Above is the formula I tried, but it gives me an error with #VALUE! Is it an issue with the order of statements? 回答1: Aggregation functions can be used in select, order by, label, format clauses. They cannot

Google Sheets query - Multiple “where” conditions with “group by” and “order by”

主宰稳场 提交于 2020-12-13 05:50:00
问题 I'm trying to use multiple where conditions (2 conditions) with 'group by' and 'order by' statements inside a Google Sheets Query formula. query(Sites!A:D,"select A,C,sum(D) where B contains 'Google' and sum(D) > 100 group by A,C Order by sum(D) desc label sum(D) 'Total Impressions'") Above is the formula I tried, but it gives me an error with #VALUE! Is it an issue with the order of statements? 回答1: Aggregation functions can be used in select, order by, label, format clauses. They cannot

Is there a Google Sheets function to squeeze a range into one column?

有些话、适合烂在心里 提交于 2020-12-13 04:34:49
问题 I wanted to find the built-in function for this to no avail so I had to write it in script: function squeeze(range) { return [].concat(...range).filter(n => n) } This JS function flattens the 2D array range and returns it. Note that it filters out empty cells with uneven columns. 回答1: While not officially documented (yet), flatten() also exists as a built-in formula. See here for more info. 回答2: if FLATTEN gets removed by some evil google dude you can do: =TRANSPOSE(SPLIT(QUERY(TRANSPOSE