How to display only filtered data range in data validation rule in Google sheet - validation

I have a table with two sheets. The first (Records) records the players from the form and a filter is performed here to determine the team (1 or 2 or 3) also.
The second table (Players) will perform calculations for individual players (one row for one player). In the first column, I will select a player using a dropdown. The problem is that all players are in the dropdown. I need the filtered ones (eg team 1 and 3). Can anyone help me? Thanks
Example sheet here
Update:
I'll apply a filter to the team first. E.g. 1 and 2 in the Records table.
Then select the winner in the Players sheet (from the filtered list 1 and 2), then select the loser from the same filtered list, but there will not be the player I just selected as the winner.

=SUBTOTAL(103; C2)
=FILTER(Records!D2:D; Records!F2:F=1)
demo spreadsheet

You may use a filter() function where you create a dynamic dropdown based on the team number you select. I have included an example where you can select a combo of a few team numbers together. If you choose only team 1 and leave the other two dropdowns blank (yellow), it will only show the names from team 1.
Dynamic Dropdown Sample

Related

How to create a custom formula using data validation that can sort columns using column numbers in Google Sheets?

I hope someone can help with a problem I’m facing. I’m pretty new to Data Validation using Custom Formulas so I’d appreciate your guidance. I hope I have explained the situation clearly. Thanks.
I want to use data validation in cell B1 (Portfolio Tab) which creates a drop down list of the number of columns (1 to 44). I want to use the list as a way to sort a table (Column Headers - C3:AT4).
https://docs.google.com/spreadsheets/d/1qunKbFGNzzGU9lNCPFow8igkR_gaPudmanTK-WM43mA/edit#gid=58173089
By selecting 1 from the drop down list I want my table to be sorted in Descending order by Portfolio%. Then if I want to sort by Name in Descending order I want to select 3 from the drop down list. Finally once I’m done sorting I want to revert back/reset to my original view. I want to do this without changing anything in columns A and B. Please assist. Thank You.
Issue with using asc
Issue with using asc (blank formula)
Query and hyperlink
Query and hyperlink
solution 1:
forget dropdown and use filter view inmerge row 3 & 4
delete row 1 & 4
select your range C2:AT
and creatte filter view
now you can sort one, multiple or all columns like:
solution 2:
create a duplicate of your sheet:
delete your range C3:AT
use this in C3:
=QUERY({Portfolio!C3:AT}, "order by Col"&B1&" desc", 2)
solution 3:
use sorting script... https://stackoverflow.com/questions/tagged/google-apps-script+sorting

How to show different groups in same matrix where no parent or child relationship

I am tasked with reproducing a spreadsheet in an SSRS report to save hours of Excel spreadsheet work. I have done all the calculations and got them into a single dataset however I am not able to work out how to display in the same table/matrix.
My spreadsheet looks like this:
Column B is a text column used to describe what the figures in each group are showing. Col C is 'Region' grouping.
I have got this far with my matrix - grouping by region and month. This gives me rows 3 to 8 incl of the spreadsheet.
But I am not able to work out how to add the next group of data (rows 9 to 12 in the spreadsheet) into the matrix. Each group of figures would use an expression to pull by a different field so only using single dataset: I still want it to use the region and month exactly the same as the top group. There is no parent or child relationship between the labels in col B in the spreadsheet.
I have tried adding an adjacent group below but it is still trying to keep it as part of the top group.
Is this at all possible?
do I need to have 6 different matrix, placing them together and just hide the month names in the bottom 5?
This is an extract of the data results. The top group counts the uniques customer id, the second group counts the unique sale id, the 3rd group totals the net sale value, the 4th group totals the profit value, the 5th group calculates the total sales and divides by the number of customers, the 6th group calculates the total sales and divides by the number of sales.
It looks like you will have to have 6 separate tablix and amend the aggregate function and field for each tablix

Highlighting with slicer Power BI

I have a Dashboard with different visuals.
Data is made up of different values for insurance companies.
I want my slicers/filters to not filter all data, but to only highlight the chosen company.
For example, in my slicer I choose the insurance ABN.
Instead of showing me the value for ABN only in my visuals, I want all other values to still be visible and ABN's value to be highlighted in the visuals.
Does anyone know how to do this?
You can use conditional formatting to achieve this. Lets say that we will change the background color to "highlight" a row (or cells, to be precise).
First, we need a slicer, which will not filter our data. We can do this by duplicating our source table, removing the unnecessary columns and making sure there is no relationship between the source and the duplicate. So if we have a source table, named Table, like this:
Right click on it and select Duplicate:
Then right click the title of the column you want to keep and select Remove Other Columns to get a list of company names only (you may also remove the duplicates, but it's not required). Then in the model delete the relation between both tables:
Now you can place a table showing company name and sales from your data source, and a slicer for company name from the duplicate table. At this point selecting values in the slicer should not affect the table.
Now you need to capture the value of the slicer and use it in a measure, which will determine should current row be highlighted or not. You can use SELECTEDVALUE for that, but note that it will give you a value only if there is a one selected in the slicer. If you want to support highlighting of more than one company, it gets a bit more complicated.
Make a new measure in your source table, like this:
Measure = IF(HASONEVALUE('Table (2)'[Company name]);
IF(SELECTEDVALUE('Table (2)'[Company name]) = MAX('Table'[Company name]); 1; 0);
IF(ISFILTERED('Table (2)'[Company name]) && COUNTROWS(FILTER('Table (2)'; 'Table (2)'[Company name] = MAX('Table'[Company name]))); 1; 0))
In case there is only one value selected in the slicer (see HASONEVALUE), then our measure will return 1 (highlight) or 0 (don't), comparing it with the current row.
Otherwise (i.e. there is no selection in the slicer, or there are 2 or more companies selected), then we will look at the filtered list of companies (Table (2)) - if it contains current row, then 1 (highlight), otherwise 0 (don't). But we will also handle the case, where there is no value selected in the slicer. In this case the list will contain all the companies, i.e. all rows will be highlighted. Here comes ISFILTERED. And at the end, if the list is filtered and current row exists in the filtered list, then 1 (highlight), otherwise 0 (don't).
Now, you need to use this measure to change the background of the column - right click each column in your table and select Conditional formatting -> Background color:
Then format by rules, where Measure >= 1 like this:
Now, when there is no selection in the slicer, there are no rows highlighted in the table:
If you select one company, it is highlighted:
It also work if there are multiple companies selected:
Thank you Andrey for your step-by-step explanation which as been incredible helpful. I'd like to follow up with a further question, particularly regarding the comment below.
"You can use SELECTEDVALUE for that, but note that it will give you a
value only if there is a one selected in the slicer. If you want to
support highlighting of more than one company, it gets a bit more
complicated."
In my model, I've linked a third table (Table (3)) to Table (2) with a many to one relationship with Table (2). Therefore when I click on Table (3), it will filter Table (2), which acts as a slicer for Table (1).
When only 1 value is filtered in Table (2), it conditionally formats the cells in Table (1). However, when more than 1 value is filtered in Table (2), conditional formatting fails.
As I'm looking to avoid manually selecting multiple values in the slicer (Table (2)), I was wondering if there's a workaround for SELECTEDVALUE such that it is able to conditionally format when I filter more than 1 value in Table (2).

Google Sheets For Filtered Drop Down

I have two sheets: CONTACTS and UPDATES.
On the CONTACTS sheet there are 2 columns: COMPANY and NAME. If I have 10 contacts at a company, then there will be 10 rows with the same company in column 1, and the names of the 10 people in column 2. Now of course there's a lot of companies and names on this list.
On the UPDATES page, column 1 is a drop down that lets me select the name of the company. In column 2 I want to have a pull down that filters and shows me only the people in the company that's in column 1.
I've searched quite a bit and while I have found things that are similar, none of the tips are quite right / work for my use case.
Is there an easy way to do this?
Thanks for your help!
You can use UNIQUE + FILTER to filter the results, but that won't give you the a dropdown. For a filtered dropdown, you can use the formula to get the filtered list and then use that as your range.
For example, in your CONTACTS tab, add a new column FilteredList, with this formula in the first row:
=unique(filter(B:B,A:A=E1))
where B:B is the NAME column, A:A is the COMPANY column and E1 is where you select the company name on the UPDATES page.
Now, instead of making the NAMES list as your valid entries, set it to FilteredList.

Google Spreadsheets multiple/scenario filter dropdown

I can create drop down filter options for each of the dimensions in the spreadsheet: month, description, and type. using data validation and then sum(filter in Google Sheets. I want to include an option in the drop-down to include all months, include all types, etc. The end product would sum the amount based on the filters selected. I can sum(filter based on individual selections but my question is how to sum the amounts if one of the scenarios was: all months, groceries only, all descriptions.
https://docs.google.com/spreadsheet/ccc?key=0AgKUNhffHpmZdHZ3TGNXOUplN1R5UUlUSW5tVVp5b1E#gid=0
You'd have to use a Pivot Table. Then you have all this things in one view.
Select colums A to D. Go to Data/Pivot Table.
Add Month to Rows and Description to Colums (or vise versa) and add Amout to Values.
You'll see a total for all Descriptions/month and Grand total/month and /description.

Resources