List top 5 scores AND names associated with those scores - excel

My Numbers spreadsheet has a column of summed scores (AA) from a gymnastics meet, the All-Around scores. Each score in this column is associated with a specific gymnast name in another column (Name).
What I'm trying to do is populate a smaller spreadsheet that will parse the top 5 (or more) scores AND names associated with those scores into two columns - one for names, the other for scores.
This should be something very simple, but I haven't ever played with Excel or Numbers and am really struggling to make sense of all the syntax and formulas.
I've created a link to an image of the columns in question for reference.
https://www.dropbox.com/s/5w819hz1iyhpdde/Scores.jpg?dl=0

Create a pivot table and the set the Top 10 (you can set later to any number)
More info:
http://www.contextures.com/excel-pivot-table-filters-top10.html

This can be broken down into three steps.
Let's say you need the 5th largest element.
Use Large to get the 5th largest element. LARGE(b:b, 5)
The above returns the 5th largest value in the b:b range. But you need to know which row number this is in the B column. For that we use MATCH. Use, MATCH(lookup value, range, 0) where lookup value is the one returned in the first step, range is again B:B and 0 means exact match.
We need to find the appropriate name associated with the largest value. We use INDEX, which finds the value at a particular index value. Use, INDEX(name range, row_number) where name range is say A:A and row_number is the one returned in the previous step.
To sum it up, you need:
INDEX(A:A, MATCH(LARGE(B:B,5),B:B,0)) to get the 5th largest name. Change 5 to whatever rank you want!

Related

Google Sheets: Searching List for Most Recent Passed Value as Sum Increases

my family and I are doing a challenge to run the distance from one city where my siblings live to another. We have a google form set up in order to log our runs and distance, and then I put in a simple sum formula to show our current total progress. However, I would like to add in a feature on the spreadsheet to show our current location on the "run".
I was able to come up with a list of the cities we would pass through along with the distance to those cities, however I would like the sheet to update to indicate Current Location: "city" when we pass through one of them.
Ideally, this would mean I could input a formula that searches the list of cities (in a second sheet tab), and then identifies when the sum surpasses one of the listed distances, and then returns the names of that most recent surpassed city. I have a copy of the sheet below.
Copy of sheet (personal data removed)
I've tried something along the lines of =INDEX(G:G,MATCH("zzzz",G:G)) for inserting the cities manually as we pass them in column G, but I would need to be constantly updating the sheet on my own in that case. I would be putting the formula in H1 of the form tab.
Hoping this is possible, appreciate any help!
In H2:
=ArrayFormula(IF(B2:B="",,VLOOKUP(SUMIF(ROW(E2:E),"<="&ROW(E2:E),E2:E),{Cities!B:B,Cities!A:A},2,TRUE)))
The first IF test leaves the Col-H row blank if the corresponding row in Col E is blank.
SUMIF returns the sum up to the current row at each row in Col E.
VLOOKUP looks up each of those progressive sums within a virtual array of the data from your 'Cities' sheet in reversed order and returns the second virtual column (which turns out to be your city name). Because all values in Cities!B:B are in perfect ascending order, the final parameter of VLOOKUP can be set to TRUE, which will return the closest value before the searched value if an exact match is not found.
In your example, you can use index match cities and sum running sheet with fixed first row to achieve your outcome, here is my solution:
=index(Cities!A:B, match(sum($D$2:D2),Cities!B:B,1),1)

Multiple Responses in Excel's Reverse Lookup

I'm trying to make a schedule of available workers after they have given me their availability. I would like a list generated of all people who say they can work on a specific day.
Ideally I would create some kind of list that looks like this:
I'm actually trying to schedule volunteers for my swim team, not employees, but the idea is the same. The form that they are filling out can also have blank spots (not shown in data table above, but possible) and the dates in the first column will also be out of order. I can manually fix both of those things, but if there is a solution that does not require me to fill in the blanks or sort the dates that would be ideal. I'm using Excel 2019 on a Win10 PC.
Starting in I2 you would have
=IFERROR(INDEX($B$1:$G$1,AGGREGATE(15,6,COLUMN($B$2:$G$7)
/(INDEX($B$2:$G$7,MATCH(I$1,$A$2:$A$7,0),0)="yes"),ROWS($1:1))-COLUMN($A:$A)),"")
so you are finding the right row in B2:G7 by doing a match on the date in column A, then finding the first, second, third... column which has a Yes in it, and finally getting the matching name from the first row.
You can see what's happening by stepping through the formula with evaluate formula:
(1) find the right row in B2:G7 by index/match
It's matching the date (stored as a number, 43466) against the list of dates in column A. The matching position is 1, which gives the row, and the column parameter in the Index function is 0 so you get the whole row.
(2) Find which cells contain 'yes'
The values in the array which do contain yes will be replaced with true and the ones which don't will be set to false.
(3) Do the division
This is the crux of the whole thing. What aggregate is going to do is to ignore the #div/0 entries (because we used option 6) and work out the lowest (minimum) column which corresponds to a 'yes', which is 2. It's the lowest because rows($1:1) just works out to 1 so you get the 'first smallest'.
(4) Adjust the column so that you get it relative to the first column of B2:G7. You could just subtract 1, but I'm trying to make it so that it still works if you insert a column to the left of the range.
5) Then all that's left is to index into the list of names in B1:G1
ending up with Albert.
As the formula is pulled down, rows ($1:1) changes to rows ($1:2) etc. so you get the second smallest column with a yes in it and so you get the second name. Eventually it errors out when there are no more matching names so IFERROR comes into play and you get a blank cell.

Subtract one cell from the cell above in Spotfire using multiple columns

How would I create a calculated column that would find the thickness of a cell that is the difference from one cell with the cell above it, but want to do this for many individual wells that have unique identifiers in a column. Additional, the last cell of that well will not have a value because there is not cell below it. On top of that I would like to play with the option of calculating this from deepest to shallowest, or shallowest to deepest so c in a column, and organized by ranking scheme (ascending or descending).
See image attached
Use a calculated column with an OVER statement (provided you're not using an in-database data connection). It will look like this:
Sum([Depth]) OVER Intersect([Well],Next([Depth])) - [Depth]
It will return the same result regardless of the row order because the Next function has built-in alphanumeric sorting which it performs on [Depth].

Excel Formula to Display multiple values (like Vlookup)

I need to perform something similar to a vlookup, but with one value I'd like to display the multiple items it discovers on a different sheet. Ex. Lookup A, A found, with information in column B that is unique, then Finds A again from a different line in the second worksheet, with information in column B that is again unique.
The multi-return is a pretty common question. The main idea is to use INDEX-SMALL instead of INDEX-MATCH. Normally you just search for the row to return using MATCH. In this case, you need to track multiple matches and return them in order. The "in order" part is best handled by SMALL, feeding it an input from ROW to get an array of increasing numbers.
Picture of ranges
Formula in cell F3 is an array formula (entered with CTRL+SHIFT+ENTER) and copied down to ensure it covers as many matches as could occur. The extra rows return #NUM! when not needed.
=INDEX($C$3:$C$8,SMALL(IF($B$3:$B$8=$E$3,ROW($B$3:$B$8)-ROW($B$2)),ROW(1:1)))
How it works.
Outside call is to INDEX which is looking at the VALUE column and returning a result from there.
INDEX needs a row number to return the value. This row number is determined by finding which rows match the given search term.
In order to find the rows, the ID column is compared to the search value in E3. That check is wrapped in an IF which returns the ROW number if there is a match.
The row number is calculated as ROW()-ROW(top) this is to account for the offset of my data starting in B3.
Once we have an array of row numbers, SMALL is used to return them in increasing order. SMALL will skip non numbers which includes the FALSE values returned for non-matching rows.
Finally, in order to a single number for INDEX, SMALL uses ROW(1:1) which will increment as the formula is copied down, giving 1-2-3-...

Retrieve specific cell, when another cell is largest, 2nd largest and 3rd largest

I've made a sheet, where 3 other cells shows the largest, second largest and third largest number. =LARGE(B2:L2;COUNTIF(B2:L2;MAX(B2:L2)))
Is it possible to make the cell show another cell, when another cell is the largest number?
The whole idea is to count votes, and then show three names, that has gotten the most votes, in different categories.
Yes this is possible.
Although I do not completely understand the formula you provided (you count how many times the maximum value appears and use that as index?), in general the approach is the following:
=INDEX(1:1, MATCH(<max_votes>, 2:2, 0))
The MATCH function looks for the value (or the value of a cell reference) in the given area. So you tell it to look for the cell where the maximum votes are (that you just found out using your formula). This column reference is given to the INDEX formula that now uses the cell in row 1 (given by argument 1:1), the column is determined by the MATCH function.
So e.g. if you max vote amount is in column C, the INDEX function will retrieve the value of C1.

Resources