Excel - Rank value based on range (X is the Yth highest value) - excel

I'm wondering if someone could tell me if the following is possible, and if it is, how one would go about achieving it please.
I am working on a event points table. For example think of a race, if a person finishes first they get 100 points, 2nd 99 points etc. There are 2 championships, an open championship which includes everyones and a members championship for a select number of people.
I have a completed open championship table which contains a column for the names of people who are racing, and a column for the number of points they achieved in that event.
In a seperate sheet I have a similar formatted table but with a column of 'members' names. What I would like to do is pull through the points from the open standings sheet but then recalculate the points rewarded to give the highest ranked member 100 points, 2nd 99 etc.
So for example if member John Doe scored 76 points in the open championship but was the highest ranked member in that event, they would receive 100 points in the members championship.
The only way I can think I could go about this is to pull the numbers through from the open champ sheet to the members champ sheet using vlookup, then rank the numbers based on a range, so '97' from '100, 97, 65' is the 2nd highest value, then take that value (-1) from 100. So 100-(2-1)=99 points
Any help would be much appreciated.

Something like this copied down might suit:
=CHOOSE(RANK(B1,B:B),100,99,98,97,96,95,94,93,92)
with the values extended as necessary, assuming columnB has the members' points from the open standing (and the names may be in ColumnA).

Related

Excel formula to find a number within a range of numbers and return a date

First time writing one of these, so I will try and explain what I'm trying to do in an understandable manner.
I'm trying to create a spreadsheet to track when a premium bond wins, and have it return the date that the winning premium bond was purchased. Because premium bonds cannot be purchased singularly, when you buy them your bond numbers are given to you a range (eg: 111AA111111- 111AA111210).
As this is the data they provide, I've set my spreadsheet up with purchase date in column A, first number of the range in column B, and last number of the range in column C.
Sample image of the sheet with example bond ranges and purchase date:
Now on a separate sheet I've listed the wins, with win date in A, winning bond number in B, and prize amount in C. In D or E I would like to somehow get it to then give me from the first sheet the date of purchase that winning bond was from.
Sample image of the sheet with winning bond numbers and month they won:
I've done a lot of googling and found similar threads to do this, but none of them have been quite what I want and I've not yet been able to work out how to tweak them into doing it. These have used index and sumproduct, but I'm yet to get it to work.
Any help in the right direction is greatly appreciated. If this doesn't make sense let me know and I'll try and explain it better.
So, like this:
INDEX($B$3:$B$5,MATCH(C9,$C$3:$C$5,1))
Not added a constraint to limit to the upper value, but you could.
This answer is pretty much the same than #SolarMike's answer but based on a diferent point of view.
If the pattern is always like 111AA111111 where 1 is a numeric value and AA is a text value and unique then you can extract the text part from each id using function MID and search for it with INDEX and MATCH:
Formula is:
=INDEX($A$1:$A$3;MATCH("*"&MID(B9;4;2)&"*";$B$1:$B$3;0))
But for this to work each AA must be unique.

Evenly Distribute Players between 2 teams in Excel

I have a group of players, 915 in total, each with different engagement scores that I am trying to break out into two evenly distributed groups based on their engagement scores. I tried using Solver in excel to set contstraints, indices etc, but unfortunately Solver can only handle 200 variables, and I have 915. Another approach I researched is to give the first group with the best player also the worst player, give the second group the second best player and the second worst player, and so on. Problem is I am not an excel wiz and need some help writing out this formula in excel so both columns A and B show "1's" for the agents that should be selected for both groups in the group A and group B columns in the below screenshot (the screenshot is a small sample of the entire data set, FYI),
Screenshot Here
As you mentioned combination of best and worst player.
Your data is already sorted on descending index. Say, the data is in A,B and C Columns. Just put A in D2 and B in D3.
Select D2 and D3 and once you get + cursor on the bottom right of the selection, double click.
Filter A for group A and B for group B.

Lookup Value based on multiple criteria

Good day everyone - I am trying to create a grade sheet for my swimming classes at school. It needs to be based on a few criteria - 1. boys/girls, 2. What stroke, 3. Time swum
I have a column for Time swum and a column with a dropdown of boys freestyle, girls freestyle etc to choose from. Then a criteria table where you get 30 point for swim x time less for each stroke for boys and girls. I was trying to use index match - but that will only return one of the strokes. As seen in the image - I need Column X to return the Points from column AB based on Column T dropdown selection, based on the range of the table with all the stroke times.
I've gotten this far : =index(AB2:AB6,MATCH(S2,AG2:AG6,1)), but that assumes all are swimming backstroke and all are girls.
I am hoping I am explaining this effectively enough.
Thanks in advance for the help.
You can use OFFSET to move the column you are matchin to the right. Also my understanding is that is for example in column "Freestyle Girls" someone reaches time 50 she should be put into line 55 - Grade A, 25 Points. If so you will need to do this:
1) reverse order of your data lines - if you want to use MATCH with last parameter "-1" (returns lowest value greater or equal to lookup value) for time (when you reach 50, you are worse then 40 so you will go to line with 55) you will need to have the values in descending order so the grades will go D to A* instead of A* to D.
2) use formula
=IFERROR(INDEX(AB:AB,MATCH(S2,OFFSET(AB:AB,0,MATCH(T2,AC1:AF1,0)),-1)),AB2)
Basically what it does is this:
OFFSET(AB:AB,0,MATCH(T2,AC1:AF1,0))
this moves the search column for the final MATCH to match the style you select
INDEX(AB:AB,MATCH(S2,OFFSET(...),-1))
this is standard search like you tried, only the OFFSET is inside so it looks in correct column.
As there is no value above Grade D it would cause error if somone nearly drowned and took 100 to finish so you need IFERROR to make sure it correct that.
Note: this assumes that value in T matches the values in the column names AC-AH. It your example the word order seems flipped. Also I put into my formula only 4 different styles so you will need to change the part stating AC1:AF1 to contain all the styles

Excel Formatting: Tracking Distance (if statements, random number, sum)

Hey there Stackoverflow users!
So I'm trying to track mileage for the distance of drives to different addresses in different cities. I made an example table of what I'm trying to accomplish. Let's say we started with 100 km and drove to somewhere in CITY2 which let's say takes between 8-25 km (there and back) so we get "KM" 10. This gets added to our start and we get 110. Now the next "start" is 110 and we drive to CITY1 which is 26-45 km for example. Let's say that was 30, which gets added to the "Start" and you get "End" which goes down. And so on and so on.
Now, I could do the basic C2 =B2+D2 and B3 =C2, but I'm not 100% sure how to check if a cell contains a certain text (in this case, "CITY#"). And if it does contain a certain CITY#, then I need to have "KM" produce a random number between a range of numbers to then get added to "Start" to result in "End."
Also here are the ranges
CITY1 (26-45),
CITY2 (8-25),
CITY3 (45-60),
CITY4 (0). The E column was just a test for search.
Any help would be appreciated!
*EDIT: So I have =IF(ISNUMBER(SEARCH("CITY2",A2)),RANDBETWEEN(26,45)) but is there a more efficient way to check the other CITY# or do I just make one long SEARCH thing?
This should at least get you started, with the caveat that all your addresses must end in "comma-space-CityName", and there are no other instances of "comma-space".
Use RIGHT and FIND to extract the city name, and then VLOOKUP the name against a table with city name and range boundaries. Finally generate and random number between the range using RANDBETWEEN.
Formula in D2:
=RANDBETWEEN(VLOOKUP(RIGHT(A2,LEN(A2)-FIND(", ", A2)-1),$F$1:$H$5,2,0),VLOOKUP(RIGHT(A2,LEN(A2)-FIND(", ", A2)-1),$F$1:$H$5,3,0))

Picking top 5 scores from a range

I run a small golf eclectic with excel. One of the things we have is a points system. I would like to get the 5 highest points scored over the season and have them ranked from 1 (being the highest points scored) to 5.
My knowledge of excel "sums" goes only a wee bit further than add and subtract.
Thanks!
If you don't want to change the order that they are presently in you can use the LARGE function. It returns the kth largest value.
Below is a great formula, if you drag it down it will automatically get the second, third and nth largest value from a table of data (in this example the data is between A1 to A10).
=LARGE(A1:A10,ROW(A1)-ROW($A$1)+1)
You can then match the values with names or corresponding data from the tables using the MATCH and INDEX functions. The example below would fetch the name for each value from the second column.
=INDEX($A$1:$B$10,MATCH(cell reference with score or value,$A$1:$B$10,2))
Play around with these formulas, they are very convenient for data m
If you have a column containing the scores, you could add a filter (Data->Filter I think) and sort descending.
Though, if you just have rows that are something like [Date][Person][Score] you'll need to go to another sheet and SUM the scores for each person then sort that... Unfortunately my Excel skills aren't up to par to pull a score for each person like that.
Given a list of numbers in A1 to A10, you can work out their 'Rank' relative to each other by using 'RANK'.
e.g.
RANK(A1,A1:A6,0)
RANK(cell, list of cells to check against, order)
For order, 0 = descending.
From there you can work out which one is first pragmatically.
If you have Excel 2007,
Check that your data is continuous, with no blank rows or columns. Click on your scores and then select 'Data - Filter'
Using the dropdown that the filter creates at the top of your scores column and select 'Number filters - Top ten'
A 'Top ten Autofilter' dialog will be displayed, reduce the show 10 to 5 and then click on OK.
For earlier versions of Excel add a RANK formula in a new column. Be careful as the scores need to be sorted, usually into descending order. If there are any ties, they will be given the same ranking number and the subsequent rank number will be incremented by the number of ties. (E.g. If there are two scores of 2, ranked as 5. The next score will be ranked as 7, not 6)
If you want to use the LARGE Function as described above, make sure you put the same range in the list for each of the LARGE functions. That is, change =LARGE(A1:A10,ROW(A1)-ROW($A$1)+1) to =LARGE(A$1:A$10,ROW(A1)-ROW($A$1)+1) or you will get some strange incorrect results

Resources