Filter pivot table conditionally - excel-2010

I need to make a pivot table of sales by cities. How can I filter it such that for Toronto and Montreal it will show sales > 50K and for other cities sales > 25K?

You'll need to adjust your source data to include a new column for "filtered" values. That column will have a formula to include your criteria. For example:
=if([city name]="Toronto",if([value]>50000,[value],if([value]>25000,[value],0)),0)
Then in the pivot table you use the new 'filtered value' column and filter out anything that is 0.

Related

How can I combine multiple columns into one column in Google Sheets?

(Note: Please simply look at the Google sheet for the quickest understanding of what I'm describing in the below bulletpoints)
My data has rows which each represent an order
Each order (row) can consist of multiple products
For each product in an order (row) there is another set of columns in the same row
I need this data to convert into only one set of columns per row (i.e. one product per row)
The products (new rows) need to remain next to eachother so the columns can't just be added to the bottom of the array (which is more simple)
Can you please take a look at the example below and help me achieve this?
Example Sheet
Screenshot of linked sheet
Try this in another sheet
=SORT({query({Reference!$A5:$A,Reference!B5:F},"select * where Col2 is not null ");query({Reference!$A5:$A,Reference!G5:K},"select * where Col2 is not null ");query({Reference!$A5:$A,Reference!L5:P},"select * where Col2 is not null ")})

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.

"Group by" in Google Sheets - finding distinct values for each column?

I have a table in Google Sheets with 4 descriptive columns and 1 numerical column (Ex. State, Region, Ethnic Group, Education Level, Population).
I'd like to create a new table in a separate tab with the distinct values for some descriptive fields and the median of the numerical field - what is the best way to do this dynamically?
If it helps, I know this is what it would look like in SQL (below), I just don't know how to do it in sheets ;)
select state, region, ethnic_group, median(population) as med_population
from TABLE
group by state, region, ethnic_group
try:
=QUERY(A:D;
"select A,B,C,avg(D)
where A is not null
group by A,B,C
label avg(D)'median'"; 1)

Google Sheets query + array + sort + transpose?

I'm working on a dynamic dashboard in Google Sheets that uses response validation to choose an student's name from a drop-down, pulling the relevant information for that particular student and adjusting the graphs/charts. One of the sections of the dashboard shows a list of events and the dates they happened, in chronological order. The order of events changes based on the order the dates happened in, which are pulling from a separate sheet (called "Database"), meaning the order of the events changes for each student.
I'm trying to create a formula that will locate the row for the currently selected student in the Database sheet, create an array with the headers of the Database sheet (for the event names) and the one row that matches the selected student's name, put that array in order by chronological date, and then transposes it so that it's a list of events in one column and their date in the other column.
I've created a copy of the dashboard and removed/edited all student information. In the sheet called "Student Tracker", I'm working in cell J7 (colored purple). It needs to pull the dates for the selected student and the header row (to label the dates) from the sheet called "studentList".
Thanks in advance for any help you can provide!
try:
=QUERY(TRANSPOSE(QUERY(studentList!A:Q,
"select E,F,G,H,I,J,K,L,M,N,O,P,Q
where A ='"&C4&"'", 1)),
"select Col1,' ',Col2
where Col2 is not null
order by Col2 label ' '''", 0)
note that columns J and K are merged so one empty column needed to be included in outer QUERY

How do I create a multiple sheets that use a google sheet named TOTAL as the data source?

How do I create multiple sheets that use a Google sheet named TOTAL as the data source? Each sheet must contain the same three columns from TOTAL and other specific data, for instance, FLUX will have six columns, three from TOTAL and three custom columns added manually.
I used a query function to import the data from TOTAL to FLUX so that updating data in TOTAL will update it also in FLUX
The data in TOTAL are not fixed. It will change adding rows, which might change the order of the list. For instance, adding the row 13 in TOTAL will shift down the data in column A:C in FLUX, but not columns D:F
Is that a way to keep the reference out of the QUERY part?
Here an example: Click me
you would need to create ID system and then you would be able to match your query with rest of the static columns. in sheet SALES remove that query and put IDs in A column. then your query will be:
=QUERY(TOTAL!A1:D, "SELECT A, B, C, D WHERE C is not null", 1)
where column A contains IDs and then you create new sheet SHEET3 and paste this query in A1
and this formula in E1:
=ARRAYFORMULA(IFERROR(VLOOKUP(A1:A, SALES!A1:G, {4,5,6}, 0), ))
I have the same problem and I can't understand few steps from the answer.
Firstly, the A columns of both sheets (TOTAL and SALES) must have IDs?
Secondly, I can't really understand how the Sheets SALES should look like. Should it be like, Col A = IDs, ColB to C query from TOTAL and Col E to G static data?
In this case is it still correct creating a query in Sheet3 reading data from TOTAL?
Thank

Resources