Excel Nested FIlter - filter

I was given as set of data and required to sum up the payout by referring to the Payment Mode (Column G).
For the calculation of monthly/semiannually, I need to sum up Eg: if January is selected it will sum the payout of Jan+Apr+Jul+Oct. May I know how can I do for this?

Related

How to calculate the ratio between the grand total of two metrics on Google Data Studio?

I created a table on Data Studio that shows the columns:
A: Date
B: 1st metric (number)
C: 2nd metric (number)
D: custom formula to calculate the ratio between the 1st and 2nd metric (percentage)
Then I checked the option to show the Summary Row that sums all the values of each date. But in the column D I don't want it to calculate the sum of the values in column D (nor the average of the values), instead, I want the ratio between the sum of the values of column D and C. How to achieve that?
To have the calculated field correctly in the total, you have to make sure to aggregate your calculated field. To do so, use 'sum()' in your calculation.
That would be this formula:
sum(total sales)/sum(gross sales)
I hope this answers your question!

Set the top 11 players on a list according to highest percentages (Google Sheets)

The list of players (COLUMN D) is ranked from most important to least important, but I want to list the 11 players who participated most in the last three matches.
If the top 11 had the same percentage, I could use the MAX function as I tried to do. But the percentages are not equal.
What I would need was to create a way to find the highest percentages until he found 11 players.
One problem is that when trying to find lower percentages, it lists more than 11 if they have more players with the same percentage.
For example: If happen to complete the list of 11 players need to define between two that have 50%, the chosen one must be the highest one in COLUMN D
I thought of FILTER + LEN to get to 11, but couldn't find a pattern for finding the lowest percentages and the highest rating in COLUMN D as a tiebreaker.
Below the spreadsheet link for ease of understanding:
https://docs.google.com/spreadsheets/d/1Fh2todBAFApGNyKw3f30p3pAAD3DHOVv6qqymHPxLyo/edit?usp=sharing
maybe try this:
=QUERY(D4:H, "select D order by H desc limit 11", 0)

Sorting/Ranking Tied Scores based on Points Difference

I wanted to use Google Sheets to do a competition ranking which can help me to rank or sort the ranking automatically when I key in the Points.
However, there is a condition where there will be a tied happens. If a tie happens, I will take the Score Differences (SD) into consideration. If the Score Differences is low, then it will be rank higher in the tie condition.
See below table for illustration:
For example: Currently Team A and Team D having the highest PTS, so both of them are currently Rank 1. However, Team D is having a lower SD compare to Team A. So I wanted to have it automatically rank Team D as Rank 1 and Team A as Rank 2.
Is this possible?
One solution might be to create a hidden column with a formula like:
=PTS * 10000 - SD
(Replacing PTS and SD with the actual cell references)
Multiplying PTS by 10000 ensures it has a higher priority than SD.
We want to reward low SDs, so we subtract instead of add.
Finally, in the rank column, we can use a formula like:
=RANK(HiddenScoreCell, HiddenScoreColumnRange, 0)
So, for example, if the HiddenScore column is column K, the actual formula for row 2 might look like
=RANK(K2, K:K, 0)
The third parameter is 0 as we want higher scores to have a lower rank.
To sort, you can just apply a sort on the Rank column.
With sort() you can define multiple sorting criteria (see [documentation][1], e.g.
=sort(A2:I5,8,false,7,false)
So you're going to sort your table (in A2:I5, change accordingly) based first on PTS, descending, then on SD, descending? You can add more criteria with more pairs of parameters (column index, then descending or ascending as a boolean).
Then you need to compare your team name with with the sorted table and find its rank in the sorted list:
=ArrayFormula(match(A2:I5,sort(A2:I5,8,false,7,false),0))
Paste that formula in I2 (assuming your table starts in A1 with its headers, otherwise adjust accordingly).
=ARRAYFORMULA(IF(LEN(A2:A), RANK(H2:H*9^9-G2:G, H2:H*9^9-G2:G), ))

Minimum sets to cover all sub arrays

I am explaining this question with little modification so that it becomea easy for me to explain.
There are n employees and I need to arrange an outing for them on such a day of a month on which all (or max) employees would be available for outing.
Each employee is asked to fill up an online survey stating his availability e.g. 1-31 or 15-17 etc. etc. And some might not be available for even a single day too.
There are no restrictions on the number of trips I have to arrange to cover all employees (not considering who arent available the whole month), but i want to find out minimum set of dates so as to cover all the employees. So in worst case scenario I will have to arrange trip 31 times.
Question: what is the best data structure I can use to run the best fitting algorithm on this data structure? What is the best possible way to solve this problem?
By best of course I mean time and space efficient way but I am also looking for other options to solve it.
The way I think is to maintain an array for 31 ints and initialize it to 0. Run over each employee and based on their available dates increment the array index. At the end sort the array of 31. The maximum value represents the date on qhich max employees are available. And apply the same logic on the left out employees. But the problem is to remove the left out employees. For which I will have to run over whole list of employees once to know which employees can be removed and form a new list of left out employees on which I can apply the previous logic. Running over the list twice this way to remove the employees isnt the best according to me. Any ideas?
As a first step, you should exclude employees with no available dates.
Then you problem becomes a variant of Set Cover Problem.
Your universe U is all employees, and collections of sets S are days. For each day i, you have employee j is in set S[i] iff that employee is available on day i.
That problem is NP-hard. So, unless you want an approximate solution, you must check every 31^2 combination of days, probably with some pruning.
Select an array from 1 to 31(each index is representing dates of a month).for each date you have to create a linked list(doubly) contains the emp_id who are available on that days(you can simultaneously create this list which will be sorted based on emp_id,and you can keep the information about the size of the list and the index of array which maximum employees).
The largest list must be in the solution(take it as first date).
Now compare each list with the largest list and remove those employees from the list which are already present in the selected largest list.
now do the same procedure and find the second date and so on...
this whole procedure will run in O(n^2)(because 31 is a constant value).
and space will be O(n).

how to calculate sum of an average field in crystal report

I have a field that calculates an average per row (Avg_Amt), it gives a correct output. My problem is how can I calculate the total summary of the average field (Avg Amt) then place it to the report footer.
Thanks & Best Regards.
Create 2 formula fields one for average and one for sum and insert this formula the first one
formula = Average ({Feild Name})
in the second formula from the report fields drag and drop the average formula and add the sum operation like :
formula = SUM({#Average})
If it is a straight average, use the sum wizard to add a sum for each field, then insert a formula field see below, this will actually get you to the accurate basis points average
(Sum ({#Field_1})/Sum ({#Field_2}))*100

Resources