I have a large database (almost 450,000 cells from A to AC columns and 15,000 rows), so I need that instead of importing all the data I just need that data from an specific month or weeknums.
Right now I'm doing it manually but it takes a lot of mi time to manually change the ranges of my IMPORTRANGE. I have a formula like:
=QUERY(IMPORTRANGE("10oV2kyv3aclctdydhZwxG3Y8VLdfkAr28aLz5fVZL1o","Form Responses 1!A2:AC"),"Select * Where year(Col1)=2017 and month(Col1)=1")
But it tells me that the result is too long...
Instead of using one open-ended range use several import range and arrays, something like:
=QUERY(
{
IMPORTRANGE("10oV2kyv3aclctdydhZwxG3Y8VLdfkAr28aLz5fVZL1o","Form Responses 1!A2:AC5001");
IMPORTRANGE("10oV2kyv3aclctdydhZwxG3Y8VLdfkAr28aLz5fVZL1o","Form Responses 1!A5002:AC10001");
IMPORTRANGE("10oV2kyv3aclctdydhZwxG3Y8VLdfkAr28aLz5fVZL1o","Form Responses 1!A210002:AC15001")
},
"Select * Where year(Col1)=2017 and month(Col1)=1"
)
Related
Having an issue figuring out a proper Google sheets formula that works
This is my reference sheet
=SUM(IF(AND('Online Arbitrage'!A:A = D5, 'Online Arbitrage'!M:M >=DATE(A2,1,1), 'Online Arbitrage'!M:M <=DATE(A2,12,31), 'Online Arbitrage'!N:N> 0),'Online Arbitrage'!H:H*'Online Arbitrage'!N:N))
I tried this formula in the "Taxes" worksheet and other variants with no success.
I am needing it to pull through the total purchases per supplier from the "Online Arbitrage" sheet based on the year that I have entered into A2.
In this example, I am expecting a result of $2,696.04 and it is producing a result of $0. I've tried other variations of this formula and it produced a result of around $5,700 which was also incorrect.
Try:
=sumproduct(('Online Arbitrage'!$A$4:$A=D5)*('Online Arbitrage'!$M$4:$M>=DATE(A2,1,1))*('Online Arbitrage'!$M$4:$M<=DATE(A2,12,31))*('Online Arbitrage'!$N$4:$N>0)*'Online Arbitrage'!$H$4:$H*'Online Arbitrage'!$N$4:$N)
You generally can't use AND/OR statements in arrays as they aggregate so won't give you the expected result. Instead, use * instead of AND and + instead of OR. I've also limited your ranges to avoid the header cells.
Sorry I know this question has been asked before - I have tried changing my query around but can't seem to get it to work as expected, doesn't look to be anything wrong..
I am simply trying to query data from one large master sheet into a few separate sheets. I am using importrange to get the data from sheet, and a simple select query to filter by one of the columns. If I do a select * I get all the data as expected, but can't use a WHERE clause with any column (I just need 1 of the columns, but I tried with a few different ones).
Appreciate any help!
Query:
=QUERY(IMPORTRANGE("1sNA9u2uQW-XjEKjrVS2a5LtTPCchwSuTkXfjhTJtvPk","Sheet1!B:I"),"select * WHERE 'Rank'='LTC' ")
Columns
Username Rank Time In Service TIS Time In Grade TIG Promotable Awards PLT/SQD
Source sheet: https://docs.google.com/spreadsheets/d/1sNA9u2uQW-XjEKjrVS2a5LtTPCchwSuTkXfjhTJtvPk
Test sheet: https://docs.google.com/spreadsheets/d/1UCucsfE0M4j95d_47iN0LrAhS0luv8wXVMHRVTHJHRQ
As player0 stated, you should refer to the columns by its number, you can select multiple columns and state multiple "where" statements by using Col1,Col2, etc respectively. In this case: Where Col2 = 'LTZ'
try:
=QUERY({IMPORTRANGE("1sNA9u2uQW-XjEKjrVS2a5LtTPCchwSuTkXfjhTJtvPk", "Sheet1!B:I")},
"where Col1='LTC' ", )
Im trying to import more than a 100 files into one masterfile.
The problem I'm having is that when I use query null to filter blank rows, some cells return as blank (probably because the entries to that cell's column may either be a text or number string)
Is there any way around this so that the query will just take the values/any string within the cell. I'd hate to see a lot of blank rows from the import of more than 100 files!
Appreciate any help. Thank you!
before using QUERY you can force the text format with TO_TEXT so:
=ARRAYFORMULA(QUERY(TO_TEXT({
IMPORTRANGE("id1"; "A1:A");
IMPORTRANGE("id2"; "A1:A");
IMPORTRANGE("id3"; "A1:A")}); "where Col1 is not null"; ))
keep in mind that every of your 100 importranges needs to be run as standalone fx prior to using the above formula to connect your sheets by allowing the access
I have a CSV file that I'm pulling from a database. It's in an awkward layout so I need to reorganise it and display the result in a separate sheet.
Here is a dummy example of the data structure I get.
https://docs.google.com/spreadsheets/d/1sTfjr-rd0vMIeb3qgBaq9SC8felJ1Pb4Vk_fMNXQKQg/edit?usp=sharing
It looks like that. The database grows every day by date and sometimes countries so I need to account to that in my formula.
I need to pull data per each country and display it by date.
I don't need data from Column A, C and D. And when there are multiple states I need to sum them up in one column.
It should look like this and keep growing downwards. I'm gonna use this table for a graph chart
What I've tried so far
=TRANSPOSE(QUERY(IMPORTRANGE("url_to_a_separate_sheet_where_I_importing_a_row_csv_file", "CSV-source-sheet!A1:500"), "SELECT * WHERE Col2='Germany'"))
This works, kinda. But pulls in unnecessary columns and I can't figure out how to sum countries with multiple states. When I add select sum(*) it gives me a big and long error. I assume it might be because of unnecessary columns that the formula cant sum up and I don't know how to omit them. I'm stuck
I tried offset and skipping no luck. Any ideas?
try:
=ARRAYFORMULA(TRANSPOSE(QUERY({Sheet2!B:B, Sheet2!E:BE},
"select Col1,"&TEXTJOIN(",", 1,
"sum(Col"&ROW(INDIRECT("Sheet2!A2:A"&COUNTA(Sheet2!1:1)-5))&")")&"
where Col1 is not null
group by Col1
label Col1'Date'", 1)))
spreadsheet demo
I got a Google Form that are pushing data into my Google Spreadsheet. It's very simple and consist of 3 cols named:
A -> Date
B -> Type
C -> Data
There is three different types, which all have same data but different values (3 types data per day). I want to use these data in a bar chart, where X is the date represented per day basis, and the Y axis is the data value. But the series should be based on type, which in the end should lead to three bars per day.
This is probably fairly simple, but since I'm quiet new to G-Sheets, I have no clue of what to look for.
Dataset looks like the following example:
04-06-2016 house 140
04-06-2016 car 185049
04-06-2016 rental 14267
etc....
Please, look at my Bar Chart Sample.
The result looks like this:
Suppose, Data is stored in range A:C. I suggest select free cell (E1) and paste there the formula:
=QUERY({A:C},"select Col1, sum(Col3) where Col2 <> '' group by Col1 pivot Col2")
It will convert Data, pivot it. Then select range wich you got with formula (E1:H8) and paste new chart, select bar type.