Ranking and then displaying results - excel

I'm trying to display the name from top to bottom based on a ranking. Can't seem to find a way to pull the info I need. I looked into VLOOKUP but the order of the cells don't work for me.
Pretty simple, I have rep, number of calls, ranked based on most calls and I want to display the names in the order of ranking. I want it to look like this
Want it to look like this:
I know its a simple solution but I am stuck.
Thinking ahead, how would I deal with same results when RANK.EQ give me 2 people on 4th position for example.
Thank you!

In V2:W2,
=SMALL(T$2:T$8, ROW(1:1))
=INDEX(Q:Q, AGGREGATE(15, 6, ROW($2:$8)/(T$2:T$8=V2), COUNTIF(V$2:V2, V2)))
Fill down.

Related

Fetching data from one sheet, to produce organised summary and display it in sections

I am trying generate a summary page for a list of lessons from a different sheet.
I'm currently using the formula =UNIQUE(FILTER('Lessons NEW'!$E2:$E1009,(RIGHT(LEFT('Lessons NEW'!$E2:$E1009,5),1)="1")+(LEN('Lessons NEW'!$E2:$E1009)=3))) to do so.
This is displaying my list like so, with the code column being the only really important one, as the rest could be fetched from it's result.
This works, but there are two features that I want working that I've not been able to find a way to do;
Split the output into groups. I am after a title to each group/section, and a gap between them too. As in screenshot here.
Arrange it to display in multiple columns (As in have half the results in column B, and half in column G for example.) In the process of this, I'd prefer the resulting sections (as in point 1, aren't broken, and kept together instead of being split between columns.
I'm not sure if what I'm asking is too much, or very much doable, but keen for suggestions or ideas if there is a way.
Thanks in advance!
EDIT:
I've updated the formula (above) and added a title to the source column that it's fetching from. It's now producing this.
What I want it to do, is to break it further for aesthetics and for easy separation when others are looking at it, and to bolden the title row for each section. (I think I can work out the conditional formatting for the title row...)
This is what I want it to end up looking like.
Google drive link to demo sheet: https://docs.google.com/spreadsheets/d/1yx9LWeV7RHfmlldUpdUZjaU8eVdOsUVaeFrfoBypeDs/edit?usp=sharing

COUNTIFS with or condition

I have a list of cities (this is a simplified version)
London
Manchester
Nottingham
I want to say something like (Obviously formula is not correct, is just to show what I am trying to do)
=COUNTIFS(MachineData!$X:$X,"Y",MachineData!$N:$N,"*london*" OR MachineData!$N:$N, "*Manchester*" OR MachineData!$N:$N,"*Nottingham*")
Basically, I want to count if its London OR Manchester OR Nottingham but also if X:X is Y
How can I do this without having to repeat the same instruction 3 times? is there a way to do this where I can tell it to check all the conditions for the cities at once?
Update: I have been trying something like
=COUNTIFS(MachineData!$X:$X,"Y",SUM(COUNTIFS(MachineData!$N:$N,{"London","*Manchester*","Oxford","*Nottingham*"})))
But this is not working for me
You are very close to a solution yourself. Try:
=SUM(COUNTIFS(MachineData!X:X,"Y",MachineData!N:N,{"*london*","*manchester*","*nottingham*"}))
edit: Use #JvdV solution. Far more elegant, less wall of text.
I created a small table as an example, five lines long reading london, manchester, nottingham, cardiff, london. The table name is table1, the column header I used was "target city"
With that in mind, this will bring the desired results into a single cell.
=SUM(COUNTIF(Table1[Target city],"london"),COUNTIF(Table1[Target city],"manchester"),COUNTIF(Table1[Target city],"nottingham"))
Result = 4
Warning: Depending on the length of the target cities you want to bring in and how frequently that list changes this might become prohibitively large/time consuming.
If you need something that will dynamically scale based of a changing list of cities you want to look for, something like python may be a better solution.
No, COUNTIFS is restricted to AND and cannot use OR.
=SUM(COUNTIFS(Table2[Category 2],"Y",Table2[Category 1],{"London","Manchester","Nottingham"}))
Suppose you have the following named ranges:
There are a couple of ways to crack this question:
Solution1:
=SUMPRODUCT(((N:N=City1)+(N:N=City2)+(N:N=City3))*(X:X=Criteria1))
For this type of question, I normally use SUMPRODUCT as a first instinct, but it is not as fast as using SUM+COUNTIFS if you are working on a large dataset.
Solution2:
=SUM(--ISNUMBER(MATCH(N:N,Cities,0)*MATCH(X:X,Criteria1,0)))
Instead of checking on individual cities, it would be faster to put the cities in a named range and check all of them at once and then add the results up.
Solution3:
=SUM(COUNTIFS(X:X,Criteria1,N:N,TRANSPOSE(Cities)))
This is the solution proposed by JvdV using named ranges.
Solution4:
=SUM((N:N=TRANSPOSE(Cities))*(X:X=Criteria1))
This will do the trick too, but I am not sure how it compares to SUM+COUNTIFS in terms of calculation efficiency on a large dataset.

Excel: Text mining using IF, ISNUMBER, SEARCH

I'm trying to clean up job title data using the formula below:
=IF(OR(ISNUMBER(SEARCH({"admin","reception","account","finance","HR","public","sales","customer","creative","IT","human"},A1))),"",A1)
It should work by eliminating job titles with any of the texts specified in the quotes above. However, I've encountered an issue where it doesn't. In a case where the job title is Quantity Surveyor, the title contains none of the specified texts but Excel seems to reflect it as such. What am I not doing right here?
Quantity Surveyor Example
To extract the information you are looking for, this is the formula you want to use:
=IFERROR(IF(OR(ISNUMBER(SEARCH({"admin","reception","account","finance","HR","public","sales","customer","creative","human"},A1)),NOT(SEARCH("Quantity",A1))),"",A1),"")
Using countif you don't need to check for errors if they occur:
=IF(OR(COUNTIF(A1,{"admin","reception","account","finance","HR","public","sales","customer","creative","human"}))+COUNTIF(A1,"<>Quantity"),"",A1)
Select the part of formula of search, and then press F9. You will find the match result of 6, where it has original value of 'IT', it means Quantity, has IT.
I really donot know why there is negative vote as not useful.
Here is the formula to solve your problem
=IFERROR(LOOKUP(1,0/FIND({"admin","reception","account","finance","HR","public","sales","customer","creative","IT","human"},A1)),A1)
Of course, it is better to define a range instead of hard code {}, like below
=IFERROR(LOOKUP(1,0/FIND($J$2:$J$7,A2),$K$2:$K$7),A2)

Select filtering and applying quantity amount to listed percentages

I tried to search but didn't find anything that was exact to what I was looking for. Let's say that I have the Investment$$ and I want to allocate that amount to only Items = to Toy Story and where Character begins with TS. The Investment $$ should only be applied to "Toy Story" and where character begins with "TS".
Apologies on not being able to embed the pictorial example to this message.
I need to write this in VBA. My questions is, is the best way to do this through a vlookup (programmed via VBA)? I want to avoid having the $1000 applied to the wrong movie title and even when it is applied to the right one (Toy Story) I want to make sure it's applied to the right ("TS") ones.
I'll also experiment on my end as well.
Pixar Movie Example
No need for VBA here. You can go with a plain vanilla Excel formula.
What you need in this situation is a key/ID item for your VLOOKUP - how you make that key is up to you, but with it you can easily utilize VLOOKUP. See my below example:

MS Excel IF statement confusion

I'm trying to make a spreadsheet for some calendars that I'm selling. I have a pricing scheme which depends on how many calendars a customer buys. I want to be able to keep track of sales, but I don't want to have to input the price per unit for each sale. I set up an IF statement that seems to work except for the last variable. Here's a screenshot:
As you can see, it works all the way to the last one. After the number reaches 11, the price per unit should drop to 6, but it doesn't! I know it must be a simple fix, but I don't know much about IF statement, so I'm stuck. Please help!
If you set up your price table similar to my set-up below, you can use a VLOOKUP formula to make it more flexible.
The formula in H10 is:
=VLOOKUP(G10,$B$1:$C$5,2,TRUE)
Enter and drag down.
The benefit of this approach is that you can change the lower bound count on the left and you'll get an adjustment without having to update the formula. Try changing the 2 in Count to 3 and you'll see the adjustments right away.
An added benefit is you can add some more values to the table for further pricing brackets.
If you must use an IF statement, try:
=IF(G10=1,9,IF(G10<=5,8,IF(AND(G10>5, G10<11),7,IF(G10>=11,6,IF(G10="","")))))
The problem with yours is it will never read the if(G10>=11 part because it has already evaluated if(G10>5
If it should have no output when G10 is blank, use the following variant:
=IF(ISBLANK(G10),"",IF(G10=1,9,IF(G10<=5,8,IF(AND(G10>5, G10<11),7,IF(G10>=11,6,IF(G10="",""))))))
I agree with #Nanashi that putting the price thresholds in a separate table and using vlookup is a better solution. That would make it possible to change the price points without having to edit multiple formulae.
But to just get your formula working, try this: =if(g10="","",if(g10=1,9,if(g1<=6,8,if(g10<=10,7,6))))
Notice that:
You don't need (and probably don't want) quotes around your numeric
values
The order of tests is important. In your original, the test for g10>=11 is never reached because it is in the else part of the g10>5 function.
A properly constructed table of quantities and pricing coupled with a VLOOKUP formula would be the best way to go and eases future pricing changes. But for the sake of diversity, your straightforward pricing structure could also be handled by the following:
=(6+(G10<11)+(G10<6)+(G10<2))*(G10>0)
In the formula, "G10>5" should be "G10<=10". Otherwise, when it gets to 11, it still meets the G10>5 criteria.

Resources