I was trying to find an answer to my question using the different examples, but I still struggle with the solution.
I have the 'orders' google-sheet that has the dates listed as columns with the data filled up below:
[list of dates in columns]
[1]: https://i.stack.imgur.com/5wyAs.png
What I want is to get the range from the 'orders' table filtered by the specified date only and other conditions. I used the formula:
=query('orders'!A1:GU2000, "select A,DI,B,D,E,F,G,H,I,J,K,L,M where DI is not null and C='RAM'")
where DI is the index of the column of the date I need.
Since the date is changing dynamically, how can I replace this manually specified DI name of the column with the dynamic element that is determined automatically from the 'orders' list by value?
So, I need to get the link to the required column from the 'orders' table by the value=today() and put it somehow dynamically to the formula above.
I'm not an expert in google sheets, unfortunately, so if someone can help me, it will be really appreciated.
try:
=QUERY({'orders'!A1:M2000, FILTER('orders'!A1:2000, 'orders'!1:1=TODAY())},
"select Col1,Col14,Col2,Col4,Col5,Col6,Col7,Col8,Col9,Col10,Col11,Col12,Col13
where Col14 is not null
and Col3='RAM'")
Related
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' ", )
I'm sure this is possible, but I've been trying various ways for the past 2 hours and can't find the solution.
I need to find all the instances of a text name in column A, lookup all the numerical results in column B and sum them together.
I thought =ArrayFormula(sum(lookup(F2,$A$2:$B$1000))) would do the trick, but it's only picking up the last value on the last mention and not all the values of all the mentions.
I've attached a spreadsheet to show the data I'm looking at.
Thanks to the reference from BigBen to check out Sumifs. Using this command, the following works a treat:
=SUMIFS(B2:B3115,A2:A3115,F2)
try:
=QUERY(A2:B; "select A,sum(B) where A is not null group by A label sum(B)''")
Ive got 4 columns that i want to summerise as part of a calculated field in a pivot table.
In Sheet 1 i have the raw data and in Sheet 2 i have the pivot table.
For the calculated field i want to sum the values for the following columns named "Alpha", "Beta", "Charlie", "Delta". In this example the columns are L,M,N,Z.
To generate this calcualted feild value do this ive been trying the following ="Alpha"+"Beta"+"Charlie"+"Delta" and also =L+M+N+Z.
But they both through errors.
Im sure its something wrong with my syntax, but cant work out what.
Any ideas ?
This also worked for me:
=sum('Alpha', 'Beta', 'Charlie', 'Delta')
Good luck :)
You need to reference your columns with single-quote:
='Alpha'+'Beta'+'Charlie'+'Delta'
Google sheet pivot only allows column name from the source data to be used as reference in the calculated field or a direct cell reference, e.g. A1.
I believe in my testing it would be:
=sum(L,M,N,Z)
From this post, you can also use ArrayFormula. So you can do this simply:
=ArrayFormula(Alpha+Beta+Charlie+Delta)
I have a Google Sheet with some stock information.
I'm using the formula GOOGLEFINANCE($B2, "price",TODAY()-15) to retrieve historical information about a stock (symbol named in $B2).
That returns a 2x2 table:
Date Close
8/25/2017 17:36:00 7.46
I only want the 7.46:
Using =FILTER(GOOGLEFINANCE($B2, "price",TODAY()-15),{FALSE; TRUE}) I get:
8/25/2017 17:36:00 7.46
I can't see to be able to nest FILTER twice.
I checked the documentation. Other than say that I should not use FILTER to filter columns and rows in the same call, I didn't get much out of it.
I gather a lot of stock information and always use index to get the stock price.
=index(GOOGLEFINANCE($B2, "price",TODAY()-15),2,2)
If you want the date use this. Be sure to format the cell as date or date/time.
=index(GOOGLEFINANCE($B2, "price",TODAY()-15),2,1)
For 2 filters try:
=FILTER(FILTER(GOOGLEFINANCE($B2, "price",TODAY()-15),{false;true}),{false,true})
I prefer query in this case:
=QUERY(GOOGLEFINANCE($B2, "price",TODAY()-15),"select Col2 label Col2 ''")
Also please try this formulas separately:
={false;true}
={false,true}
and see the result.
I have two sheets, Progress and App1stSession, in the same spreadsheet.
Progress sheet has these columns
Date Campaign Sessions 1stSessions
App1stSession sheet these columns
Date Campaign 1stSessions
I need to retrieve 1stSessions values from App1stSession. The match can be done on Date and Campaign values.
I've written this formula
INDEX(App1stSession!$A$1:C,
AND(MATCH($B1,App1stSession!$B$1:B,0),MATCH($A1,App1stSession!$A$1:A,0))),3)
Of course it doesn't work because AND retrieves 0 or 1.
So I've tried this solution
INDEX(App1stSession!$A$1:C,IF(AND(MATCH($B1,App1stSession!$B$1:C,0),MATCH($A1
,App1stSession!$A$1:A,0)),MATCH($C1,App1stSession!$C$1:C,0)),3)
I suppose that the second MATCH could retrieve the right row: neither this solution works.
Finally I've tried
=QUERY(App1stSession!$A$1:A,"SELECT """&App1stSession!$C1:C&""" WHERE
("""&App1stSession!$A$1:A&"""="""&$A1&""")AND("""&App1stSession!$B$1:B&"""="""&$C1&""")")
Again it doesn't work but I suppose because of a matter of syntax.
Any suggestion ?
Thanks
The way I would do it, is insert one unique id column/search key in column A, before the rest of your data, that is dynamically created by the date & campaign values in your App1stSession sheet:
=B1&C1
then use this type of formula to smush the same two values together dynamically on your search sheet in a vlookup fashion on your progress sheet:
=VLOOKUP(A1&B1,App1stSession!A:D,4,false)