google-sheets-query

How to use AVERAGEIFS within ARRAYFORMULA

余生长醉 提交于 2020-01-05 04:11:26
问题 I am trying to use AVERAGEIFS inside ARRAYFORMULA . Looking at other questions, I have come to the conclusion that it is not possible without using QUERY function. My intention is to average the values of a column whenever they share the same ID. I think this question comes pretty close to what I need, but I haven't been able to replicate and adapt its solution on my own sheet. In this sheet I show the result I expect (I got it by dragging the formula). I've also reviewed the Query Language

QUERY using cell contents as SQL variables

不想你离开。 提交于 2020-01-01 03:42:48
问题 Here is what the spreadsheet I'm working with looks like: Summary table (top of sheet) Source data (same sheet, below output) I'm using the QUERY function to populate the appropriate feeds in the summary table with the data starting at A24 needs to be placed into. Here is the formula I'm using in cell C6 (similar formulas are used throughout the summary table): =QUERY($A$24:$D$57, "Select D Where B='ENQ' and A='2/27/14 - Thu'") This gets the right information, but the formula needs to be

Query one table and output data into multiple columns

半城伤御伤魂 提交于 2019-12-31 04:28:30
问题 Simply put I am trying to take a single column query result and output it into a 5 wide by × long table. This is how the main table is organized. On separate tabs, I want to list all of the caught and seen Pokemon on their own for easy search. While I can get it to output something like this with =query(NatDex, "Select C Where F <> ''",1) I would like it to output the data something like this for easy reading so it's not eventually 100+ entries long: Bonus points if you can give me formula

Countifs in Google Sheets with various 'different than' criteria in same row adds +1 value

吃可爱长大的小学妹 提交于 2019-12-29 09:35:13
问题 I'm trying to count all values different than some specific criteria on the same row in a Google sheet that is feed via a google form but the final count shows "1". The row I'm counting from corresponds to a multiple choice question that has an 'other' option so the user can enter other values and I'm trying to count the number of 'other' values in the row. I tried normal count and couldif but when you use a <> it ends up counting to infinite if you want to check a B2:B range (B1 Is the

How to dynamically increase or decrease limit value in Query of Google sheet

主宰稳场 提交于 2019-12-25 01:27:52
问题 So my task is to get last x rows based on some count calculation and for that, I'm using limit offset in a query. To elaborate more, I have this formula that works fine =COUNTIF(QUERY(A:A,"limit 5 offset "&(COUNT(A:A)-5),A1)>1 The problem here is that I don't want to "Hardcode" that value of "5" since my range changes based on the count of some timestamp function I'm using on another column. SO I made some changes in above formula by adding another count function that checks the other column

Transpose Unique Values from Multiple Columns

拈花ヽ惹草 提交于 2019-12-24 10:49:51
问题 I'm trying to generate unique values in D1:F but my formula is not working. For example, row 1 has A B C milk milk 44 the output should be: D E milk 44 here is my formula and my sheet =ARRAYFORMULA(unique(A1:C)) 回答1: UNIQUE works only in one dimension (row or column) =QUERY(UNIQUE({A:A;B:B;C:C}), "where Col1 is not null", 0) =ARRAYFORMULA(SPLIT(REGEXREPLACE(SUBSTITUTE(TRIM(TRANSPOSE(QUERY(TRANSPOSE({QUERY(QUERY( UNIQUE(SPLIT(TRANSPOSE(SPLIT(TRIM(QUERY(TRANSPOSE(QUERY(TRANSPOSE( IF(LEN(A2:A),

Google Sheets: select top N cases within groups using QUERY

你说的曾经没有我的故事 提交于 2019-12-24 09:01:36
问题 I want to make a report: "select salesmen who have N recent Status codes = 2,3,4,5". A structural example of my data has 35 rows (including 1 header row): link. This file has a Date , Sales code (id of a salesman), Status code (id of how successful a transaction was) and other fields which are not necessary for the purpose. I ended up using three formulas: a QUERY function with IMPORTRANGE . In the example data it is slightly simpler - take only Sales Codes, Status Code, and Date from another

How do I return a string that the built in Google Spreadsheet function can us

老子叫甜甜 提交于 2019-12-24 06:34:48
问题 I have a function that returns a string that are the cells that I need to scan with the UNIQUE() built-in function, but it does not process the returned value. Tried putting them in quotes, didn't help. function GetRange(sheet, ColumnLetter , Offset) { var startColumn = letterToColumn(ColumnLetter); var string = ""; for(var i=startColumn; i <= Offset; i++) { string += sheet + "!" + columnToLetter(i) +":"+columnToLetter(i)+";"; } string = string.substring(0, string.length-1); return string+"";

Using MIN() inside ARRAYFORMULA()

£可爱£侵袭症+ 提交于 2019-12-22 05:52:33
问题 I've seen some examples of using SUM() inside an ARRAYFORMULA() in Google Spreadsheets (and oddly enough, they all seem like workarounds) but I can't figure out how to apply them to using MIN() instead. Let's say I have columns A , B and C and I just want to get the result of MIN(A:C) on the D column, just for the three cells that would match each row. The straightforward way should be ARRAYFORMULA(MIN(A1:C)) but surely enough that doesn't work. How can I programmatically calculate the MIN()

sum value from a date range for a specific product

丶灬走出姿态 提交于 2019-12-20 06:41:03
问题 I am looking to sum up multiple values from multiple cells where they will match a date and a product. like below: I have a date set in every cell in row 2 as below, and I have my categories in column A now I want to pick the total value (that is unit costs) from (below picture) this sheet where the date is equal to 1-dec (date) and the category is equal to office. I tried using this formula ( =sum(query(DataSheet!A3:J10, "select a,c,i where a= '"&C2&"' and c= '"&A4&"'",0),0) ) - but it is