Questions tagged [google-sheets-query]

Use for question about the QUERY function of Google Sheets.

Use this tag for questions about the QUERY function of Google Sheets.

QUERY is a non-standard spreadsheet function. It uses Google Query Language

It could be used together with

Usually it will not be used with

1444 questions
2
votes
1 answer

date diff function in query of google sheets

I got the below result using the formula ={query(SALES!A2:Y ,"Select B, C, D, G, P, Sum(T), datediff(now(), todate(P)) WHERE O ='"&(A1)&"' GROUP BY B, C, D, G, P ORDER BY datediff(now(), todate(P)) DESC Label Sum(T) 'PENDING AMOUNT',…
2
votes
1 answer

SUMIF in Google Sheets for a month and if a column contains text

I have some simple data in the following format: I need to make a sum of the last column, but based on the text in Domain column. The resulting table should be like this...given the text filtering needed, I'm not using pivot tables. To do this,…
2
votes
1 answer

Google Query Return Top N results per category

I have a Google Spreadsheet with several tabs (same columns, split up based on country) https://docs.google.com/spreadsheets/d/1I4cS4oNjCFZ7dWF78rBv6cdHkyWHAF8rGoIlt0941aI/edit?usp=sharing I need to have this data copied to my "Master" sheet where I…
2
votes
3 answers

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

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…
2
votes
1 answer

What is proper way of searching a row by column value in spreadsheets API

I am trying to search row by column value in spreadsheet (Google Sheets) API Google documentation having API for find & Replace but no API available for find/search. Some approaches i already tried to achieve searching by value in…
2
votes
2 answers

Google Sheets Count if Consecutive numbers are Less than

I have a set of data in column A looking like: A B 150 155 200 140 122 250 299 I would like to get a "Yes" statement if there are 2 or more consecutive numbers less than the value in B1 (155), so far my formula…
2
votes
1 answer

Google sheets find MIN time of min price

Given the following data: 123 2020-06-22 23:00:00 124 2020-06-22 23:30:00 121 2020-06-23 00:00:00 I want the hour/minute of the minimum price in a Google Sheet. I tried using without success: =QUERY(A:B,"select hour(B), min(A) group by…
2
votes
2 answers

Using a query with a datetime cell in spreadsheets

I need to query a cell that contains a datetime but its formatted by default when I import it to only show the date. 31/7/2020 19:18:58 (in reality it's like this) 31/7/2020 (but it shows this) So when I run this query: =QUERY(A5:R10, "select…
2
votes
2 answers

Filter IMPORTHTML data

When I import data, it comes in this format (image 1), with blank spaces. I would like to know if there is any way to adjust so that these blanks disappear, the two models expected (image 2 and 3) if there was any way to reach them would be…
2
votes
1 answer

Go from wide-table format to long-table (dynamic)

I am trying to go from a 'wide-formatted' table see image sample to a 'long-formatted' table see image sample using Google Spreadsheets. I have created an spreadsheet to re-create the scenario, having this in mind: Data is being updated by users on…
2
votes
2 answers

Google sheets "MODE" function for non-numeric values

I'm trying to write a Google Sheets function that does the same as the MODE function, but for non-numeric values: returning the most frequently occuring string in a specified range. I've searched the entire internet, and everywhere it's being…
2
votes
2 answers

Converting two columns table into one column table in Google Sheets

In column A there is a list of tasks. In column B each task has an associated group. How to, using built-in formulas, generate sequence like in column D? Here is a screenshot :
2
votes
1 answer

QUERY function works in example sheet but not in a new sheet with same formula

I get error when using the formula in a new sheet, but the same formula works in google`s example sheet. What am i doing wrong?
2
votes
1 answer

How to return "Empty" where a query returns empty cells Google sheets

I have two columns. The first one contains names and the second some numbers. I am perfoming a query on the two columns but some of the cells in the second columns will not contain any value. I need to return "Empty" in those cells but I seem not to…
2
votes
1 answer

Sort timesheet logged hours by week

So I have a timesheet for a project I'm working on, and I'd like to see how many hours I've worked by week. I found an answer from this post: Create Weekly/Monthly/Yearly line chart in Google Sheets to sum amounts within same week/month/year range…