Hello I need help with a formula. I want to pull certain information from all 3 sheets and putting it on another google sheet spreadsheet.
Example of the info I need is all of Driver Bs information from Column A, E, F, H, I, K from week 6.There is more information on Sheet 2 and 3 from that week also that needs to be pulled.
I have this idea for the formula. I put U without a number next to it because there is rows of information constantly being added to the google docs.
=IMPORTRANGE("https google sheet goes here","Sheet1!A1:U" "Sheet2!A1:U" "Sheet3!A1:U"}, "where Col4 = 'Driver A'", "where Col21 = '6'", 0)
try:
=QUERY({
IMPORTRANGE("1tnAtFgxCl2DnyYL0cjzijsqw8WlvC1BxI80hduaPwi0", "Sheet1!A1:U");
IMPORTRANGE("1tnAtFgxCl2DnyYL0cjzijsqw8WlvC1BxI80hduaPwi0", "Sheet2!A1:U");
IMPORTRANGE("1tnAtFgxCl2DnyYL0cjzijsqw8WlvC1BxI80hduaPwi0", "Sheet3!A1:U")},
"select Col1,Col5,Col6,Col8,Col9,Col11
where Col4 = 'Driver A'
and Col21 = 12", 1)
Related
I am trying to merge Sheet1 & Sheet2 into Sheet3. On Sheet3 I would like Column A to display which Sheet the data came from.
Sheet1 (Source #1)
A
B
John Doe
123 Street
Sheet2 (Source #2)
A
B
Jane Smith
999 Street
Sheet3 - Expected results using the formulas below.
A
B
C
Sheet1
John Doe
123 Street
Sheet2
Jane Smith
999 Street
I have tried the following formulas.
=ARRAYFORMULA(
{
{"Sheet1",FILTER('Sheet1'!A1:B,'Sheet1'!A1:A<>"")};
{"Sheet2",FILTER('Sheet2'!A1:B,'Sheet1'!A1:A<>"")}
}
)
=ARRAYFORMULA(
{
{"Sheet1",QUERY('Sheet1'!A1:B,"SELECT * WHERE A is not null")};
{"Sheet2",QUERY('Sheet2'!A1:B,"SELECT * WHERE A is not null")}
}
)
Both give the error: In ARRAY_LITERAL, an Array Literal was missing values for one or more rows.
What am I doing wrong? Thanks!
Try:
={QUERY(Sheet1!A:B; "select 'Sheet1',A,B label 'Sheet1'''"; );
QUERY(Sheet2!A:B; "select 'Sheet2',A,B label 'Sheet2'''"; )}
Since you can't append the sheet name to multiple rows, you need to get creative.
What this does is combine the columns into one and append the sheet name per row together with the same delimiter used inside the query. Then append both results then proceed to split them using the said delimiter.
Formula:
=ARRAYFORMULA(SPLIT({
{"Sheet1×"&QUERY({Sheet1!A1:A&"×"&Sheet1!B1:B}, "where Col1 != '×'")};
{"Sheet2×"&QUERY({Sheet2!A1:A&"×"&Sheet2!B1:B}, "where Col1 != '×'")}
}, "×")
Output:
I am clear that there is no concat method in google sheets queries but I'm hoping for a workaround. I've seen some suggestions for transpose but can't seem to apply them to my use, hoping for help.
My actual source sheet has more complexity in columns but I've simplified it to demonstrate
Existing Query
=query($L$10:$N$27, "SELECT L, M WHERE N = 'Full' LABEL L 'Name', M ''",1)
If Concat/Append were available it would look more like
=query($L$10:$N$27, "SELECT ("Name is: " & L & " " & M) WHERE N = 'Full' LABEL L 'Name'",1)
Thanks!
try:
=ARRAYFORMULA(QUERY({"Name is: "&L10:L27&" "&M10:M27, N10:N27},
"select Col1
where Col2 = 'Full'
label Col1 'Name'", 1))
Keep getting #VALUE! or #ERROR on everything I try, I think I'm using the wrong function entirely but don't know the best alternative.
I've tried a few IF blanks and what not but no luck, I've only just started on google sheets a few days ago.
I've tried a query I used on another sheet and changed it around a little, I had some success but with my lack of knowledge.... it didn't do everything I needed and it didn't work when I tried to use it involving all the sheets I needed, just a single sheet it worked for. I tried to search for something but I was just going in circles.
=QUERY({KME!$A$2:$D$157;'KME1'!$A$2:$D$157;'KME2'!$A$2:$D$157},"select * WHERE C < 300 OR D <10000",1)
=QUERY(KME!$A$2:$D$157,"select * WHERE C < 300 OR D <10000",1)
I have a set of data across 3 sheets. I need to filter the data, I want it to select all the data which I used select * for.
I want it to only show results from:
Column C if below 300
OR
Column D if below 10,000
I also want it to not show results that have empty cells in C and D
try it like this:
=QUERY({KME!A2:D157; 'KME1'!A2:D157; 'KME2'!A2:D157},
"where Col3 < 300
or Col4 < 10000
and Col3 !=''
and Col4 !='' ", 0)
or like this:
=QUERY(QUERY({KME!A2:D157;'KME1'!A2:D157;'KME2'!A2:D157},
"where Col3 < 300 OR Col4 <10000", 0),
"where Col3 is not null and Col4 is not null")
I need some help with a database I am trying to create on excel. Currently, I managed to build a system where I paste on to the excel sheet a receipt, then a macro extract certain pieces of information and stores it in another sheet, something like this;
BUYER SELLER DATE PRODUCTS CURRENCY
A B 123 abc USD
D E 456 def GBP
Now, I can search this database using simple filtering. What I would to do now is, once I have filtered and am left with, lets say, 5 entries, I would like those to be reconstructed in another sheet, looking like the receipts do originally e.g
123 456
A D
B E
USD GBP
a d
b e
c f
I know I need to loop through each row and once in a row, loop through each column to extract the required piece of information(e.g date, products etc).
I have looked around and couldn't find anything.
Any help would be appreciated, thank you.
I think that this can help you to start:
Sub From_DB()
Dim i As Long
Dim col As Integer
Dim DB_Sheet, Rec_Sheet As Object
Set DB_Sheet = ThisWorkbook.Worksheets("Database")
Set Rec_Sheet = ThisWorkbook.Worksheets("Receipts")
col = 1
For i = 2 To DB_Sheet.Range("A" & Rows.Count).End(xlUp).Row
If DB_Sheet.Rows(i).Hidden = False Then
Rec_Sheet.Cells(1, col) = DB_Sheet.Cells(i, 3)
Rec_Sheet.Cells(2, col) = DB_Sheet.Cells(i, 1)
Rec_Sheet.Cells(3, col) = DB_Sheet.Cells(i, 2)
Rec_Sheet.Cells(4, col) = DB_Sheet.Cells(i, 5)
Rec_Sheet.Cells(5, col) = DB_Sheet.Cells(i, 4)
col = col + 1
End If
Next i
End Sub
I have a dataset with two tabs, one with monthly goal(target) and another tab with sales and order data. I'm trying to summarize sales data from the other tab into the target tab using several parameters with an Index(Match and SumIfs:
My Attempt:
=SUMIFS(INDEX(OrderBreakdown!$A$2:$T$8048,,MATCH(C2,OrderBreakdown!$G$2:$G$8048)),OrderBreakdown!$I$2:$I$8048,">="&A2,OrderBreakdown!$I$2:$I$8048,"<="&B2)
Order Breakdown is the other sheet, column D in OrderBreakdown sheet is what I want to sum if OrderBreakdown_Category(Col G) = Col C and if OrderBreakdown_Order Date(Col I) >= Start Date(Col A) and if OrderBreakdown_Order Date(Col I) <= End Date(Col A)
My answer should be much more in line with Col D but instead I'm getting $MM
Here's a sample of the dataset I'm pulling from:
dataset I'm pulling from
Ok, I am not sure why your range to sum is from A through T - that is probably where you went wrong. Also, I did not find the index method necessary. This should work for you
=SUMIFS(OrderBreakdown!$D$2:$D$8048,OrderBreakdown!$I$2:$I$8048, ">=" & A2,OrderBreakdown!$I$2:$I$8048, "<=" & B2, OrderBreakdown!$G$2:$G$8048, "<=" & C2)
Here is my sample data Starting on first sheet row 2
1/1/2011 1/30/2011 Office Supplies
Then the orderBreakdown tab starts on column C
Discount Sales Profit Quantity Category sub-category OrderDate
0.5 $45.00 ($26.00) 3 Office Supplies Paper 1/1/11 Eugene Mo Stockholm Sweden North Home Offic 1/5/11 Second Cla: Stockholm 2011-(11 0.1-2011 2011 1/1/2011
0 $854.00 $290.00 7 Furniture BookCases 1/2/2011
0 $854.00 $290.00 7 Furniture BookCases 12/32/2010