Query function with multiple criteria - google-sheets

So I have a spreadsheet and I want to search for two criteria in two different columns. When i entre my equations it returns no data except the column headings.
=QUERY(MukuluFarmsMasterData,"select A,B,N,O,P,Q,R,S,T,U,V where B = 'SERVICING' and F = 1")
So I want the table to return all the information that satisfy both conditions. So in column B I want everything that is Servicing and From column F = 1. I would also like to sort the date in Descending order.
This is a screenshot of the spreadsheet.
enter image description here

Related

Add\remove row based on value

I got a table_1 that has 2 columns in (Q and R) the end with checkboxes.
I want to create and secondary table_2 that has dependency on the table_1 in such a way that it imports rows from Table_1 when I have TRUE value in column Q but removes it when I set value to TRUE in column R.
I tried using Filter, but it does not work after I alter data in table_1.
Basically, I want to make it work all the time. Not just once.
https://docs.google.com/spreadsheets/d/1I9RwXYBeibhL-mQBsSZHbB5QEBD24gbUBWldBucNmsw/edit?usp=sharing
You should use FILTER formula or QUERY formula.
Let's say you want to have a Sheet2 based on Sheet1 where you show only orders paid (P) but not delivered (Q) yet:
Source sheet according to your link:
Solution:
=FILTER(Sheet1!B2:R;Sheet1!P2:P=TRUE;Sheet1!Q2:Q=False)
First parameter: Sheet1!B2:R tells what will be displayed (all rows from 2 to the end and columns from B to R)
Second and Third parameters set conditions that are checked for each row separately.
If you want to have tick boxes in Sheet2, you should select P and Q columns and use Menu --> Insert --> Tick box.
It will change format of these columns but will not affect the content.

In Google sheets, How to do Vlookup unique data from multiple column

My Vlookup formula is the following currently:
(Weekly Consolidated Sheet)
Column C:1
=iferror(arrayformula(if(D:D="Item No.","Document No.",('For NAV'!C3:C))),"")
Column D:1
=iferror(arrayformula(if(A:A="Posting Date","Item No.",Unique('For NAV'!D2:D))),"")
Column I:1
=iferror(arrayformula(if(A:A="Posting Date","Quantity",sumif('For NAV'!D:D,D:D,'For NAV'!I:I))),"")
I would want to consolidate data from "For NAV" sheet into "Weekly Consolidated" Sheet.
"For NAV" Sheet has duplicate Item No. which I want to make it Unique and Sum the total Quantity (Column I)
Now that the document number seems to be the main Criteria I am stuck.
The following is what I need:
Main Criteria = Document No
Example:
ADW 01-07/03
-Item number which has same document number should consolidate its own Unique item number and sum the Quantity
ADW 08-14/03
-Item number which has same document number should consolidate its own Unique item number and sum the Quantity
Other columns is OK i can vlookup from "Item Listing" Sheet based on the Item code
Link for the spreadsheet as below:
https://docs.google.com/spreadsheets/d/1SL63pIF35skZjjbFjTRgfsbSYHvDr-gRRKciZbYFRUU/edit#gid=1168278681
Try changing your formula in I2 to
=ArrayFormula(iferror({"Quantity";sumif('For NAV'!C3:C&'For NAV'!D3:D,C2:C&D2:D,'For NAV'!I3:I)}))
The way this works is by making a unique string generated from the values on the C and D columns to compare between sheets. In this case you can simply joining them together because the the C column is always the same size.

Google Sheets Formula: List Column A input if Column G input is equal to "X"

I am interested in finding a formula that will allow me to make lists of cell input from Column A, but only list the cells that have a certain value in the same row in Column G.
Here's more information: I am doing rosters for my school. Each row is a different student, their name entered into Column A. Columns G through J are their assigned classes on certain days. I would like to pull lists of students who have certain classes on specific days (Tuesday through Friday). For instance, I would like a formula that allows me to make a list of all students (Name from Column A) whose class listed in column G is "Art." So basically I want to pull daily class rosters.
Any help would be greatly appreciated by me and all of my teacher colleagues!
Thanks!
=FILTER (A1:J200,G1:G200="Art")
Or
= FILTER ({A1:A200,G1:G200},G1:G200="Art")
You're looking for this function FILTER
You could also use QUERY
=QUERY (A1:J200,"Select A,B,C,D,F,G,J Where G contains 'Art'")

Array Formula to Find Multiple Criteria and Return Multiple Matches

I know I can do this with a query, but I don't want to have a formula on each line (my original spreadsheet has 1000+ lines). I'd rather do it with an array formula.
I am trying to find student records that match a student number and a course number. This would be easy enough to do with vlookup but many students take a course multiple times so I want it to potentially return multiple results.
Student # is ColA, course title is ColB. In F4 I want an array formula that will go down ColF, match the student number, and return matches (in ColF and ColG) that correspond to a course code (in this case, ENG30* (matches could be ENG301, ENG302, ENG303...).
link
Here you go:F4=
=QUERY(A1:B25000,"Select A,B where B contains 'ENG30'",1)
EDIT:
K4:
=QUERY(A1:B25000,"Select A,B where B contains 'ENG30' and A matches '"&JOIN("|",E4:E446)&"' order by A",1)
M4
=ARRAYFORMULA(IF(K4:K250=K5:K251,L5:L251,""))
F4
=ARRAYFORMULA(IFERROR(VLOOKUP(E4:E446,K4:M245,{2,3},0)))

Sum multiple 2-way lookup values in one equation

I've conquered a 2-way lookup for one Y axis and one X axis value using
=SUMPRODUCT((Y_AXIS_VALUE_ARRAY = Y_LOOKUP_VALUE)*(X_AXIS_VALUE_ARRAY = X_LOOKUP_VALUE), LOOKUP_ARRAY)
However what if I had multiple Y_LOOKUP values and multiple X_LOOKUP values and wanted to sum the results of all of them in one equation is this possible.
The example below shows what I'm after in this example the formula should return 105.78 (80.45 + 25.33).
The formula mentioned above when used to where X/Y Lookup values are an array of values returns Error
Array arguments to MULTIPLY are of different size.
Here is my test google sheet: https://docs.google.com/a/rentping.com/spreadsheets/d/1GWQHAclo19f1VxLBixI4eyKJDN1QRk6SzXKJDWj6ZaE/edit?usp=sharing
The "Test" sheet contains the interface where X/Y Look up values are selected, and the "Items" sheet contains the table that is being referenced.
Columns L, M, N, O are where the selection is made and Column K is where the formula goes. As you can see when only ONE column has a selection the formula accurately gets the value, but as soon as a second value is selected in the those columns the formula breaks down.
An easier way to perform double lookup is to use filter twice: for rows and for columns. The wrapper iferror suppresses output when nothing is found.
=iferror(filter(filter(Items!A:Z, Items!A:A = L2), Items!A1:Z1 = L3))
With 4 columns to choose from, I'd go with
=iferror(filter(filter(Items!A:Z, Items!A:A = L2), Items!A1:Z1 = L3))
+iferror(filter(filter(Items!A:Z, Items!A:A = M2), Items!A1:Z1 = M3))
+iferror(filter(filter(Items!A:Z, Items!A:A = N2), Items!A1:Z1 = N3))
+iferror(filter(filter(Items!A:Z, Items!A:A = O2), Items!A1:Z1 = O3))
Alternatively, have additional hidden columns with lookups (one hidden column for each input column), and then column K can be a simple sum over hidden columns.

Resources