Returning Column Index/Value Based on Max value of Specific row - excel

Sorry if I have completely butchered the terminology in the title. Relatively new to Excel.
I have the following table.
Name
Score A
Score B
Score C
Bob
10
8
6
Sue
9
12
10
Joe
11
2
4
Susan
7
9
10
Tim
10
12
4
Ellie
9
8
7
What I am trying to achieve is that for each person, to return the score type for that person's best score. I'm referencing the person's name on another sheet.
For example. For Susan;
Their best score is 10 and that is under Score C.
So I want the final value in the Score Type column in my other sheet for Susan to be Score C
Like so
Name
Best Score
Score Type
Ellie
9
Score A
Bob
10
Score A
Susan
10
Score C
I know to get the index of each persons row by
=MATCH(A2,$A$2:$A, 0)
I can get the max value for that person via
{=MAX(IF($A$2:A = A2,($B$2:$D)))}
I'm just not sure how to use that information to return the column label corresponding to the person and their max score.
Any help would be greatly appreciated

I think it is pretty easier. Try-
=INDEX($B$1:$D$1,MATCH(MAX(B2:D2),B2:D2,0))
For dynamic spill array-
=BYROW(B2:D7,LAMBDA(x,FILTER(B1:D1,x=MAX(x))))
EDIT: Then try below formula-
=INDEX($B$1:$D$1,1,MAX(($A$2:$A$7=$I3)*($B$2:$D$7=$J3)*(COLUMN($B$2:$D$7)))-COLUMN($A$2))

For Larger Data you could use this one

Related

Google sheets formula to get the Top 5 List With Duplicates

I'm trying to compile a best 5 and worst 5 list. I have two rows, column B with the number score and column C with the name. I only want the list to include the name.
In my previous attempts the formula would get the top/bottom 5 but as soon as a duplicate score appeared the first known name with that value would just repeat.
Here is my data
26 Cal
55 John
55 Mike
100 Steve
26 Thomas
100 Jaden
100 Jack
95 Josh
87 Cole
75 Brett
I've managed to get the bottom 5 list formula correct. This formula works perfectly and includes all names of duplicate scores.
Example of what I get:
Cal
Thomas
John
Mike
Brett
=INDEX($C$56:$E$70,SMALL(IF($B$56:$B$70=SMALL($B$56:$B$70,ROWS(E$2:E2)),ROW($B$56:$B$70)-ROW($B$56)+1),SUM(IF($B$56:$B$70=SMALL($B$56:$B$70,
ROWS(E$2:E2)),1,0))-SUM(IF($B$56:$B$70<=SMALL($B$56:$B$70,ROWS(E$2:E2)),1,0))+ROWS(E$2:E2)))
Here is the formula I've tried to get the top 5 - however I keep getting an error.
=INDEX($C$56:$E$70,LARGE(IF($B$56:$B$70=LARGE($B$56:$B$70,ROWS(E$2:E2)),ROW($B$56:$B$70)-ROW($B$56)+1),SUM(IF($B$56:$B$70=LARGE($B$56:$B$70,
ROWS(E$2:E2)),1,0))-SUM(IF($B$56:$B$70<=LARGE($B$56:$B$70,ROWS(E$2:E2)),1,0))+ROWS(E$2:E2)))
Example of what I'm looking for
Steve
Jaden
Jack
Josh
Cole
You can set two queries like this for both cases:
=QUERY(B56:C70,"Select C order by B desc limit 5")
=QUERY(B56:C70,"Select C order by B limit 5")
Use SORTN() function like-
=SORTN(A1:B10,5,,1,1)
To keep only one column, wrap the SORTN() function with INDEX() and specify column number. Try-
=INDEX(SORTN(A1:B10,5,,1,1),,2)

How to check if a record exists based on month and persons name (where the name is duplicated)?

I have a data-set with some names and months, sample:
Name Month
Max 2
Sally 5
Max 1
James 11
Richard 9
Sally 9
I then have a table as such:
Month
Name 1 2 3 4 5 6 7 8 9 10 11 12
Max
Sally
James
Richard
How do I create a formula that can enter "Yes", or "No" for each month based on the person's name? For example, Max would have months 2 and 1 displaying "Yes", all other months displaying "No".
I can't think of how to do this...using an INDEX/MATCH function I can pull up the first month for "Max", but it won't register the second time his name shows up (it just matches the order of his name with where his data lies in the array, doesn't consider duplicates).
Is there a way to do this?
Thanks.
Assuming a data setup like this:
In cell E3 and copied over and down is this formula:
=IF(COUNTIFS($A$2:$A$7,$D3,$B$2:$B$7,E$2),"Yes","No")

Index-Match function with NOT EQUAL criteria

I am trying to use the index with match function to give me the order of people based on their rankings. My data is something like this:
A B C
1 Rank Name Score
2
3 1 Joe 100%
4 3 Bob 80%
5 1 John 100%
6 2 Dan 90%
7
8 RankOrder Name
9 1 =index(b3:b6,match(1,a3:a6,-1)) Result = Joe
10 1 =index(b3:b6,match(1&<>"b9",a3:a6,-1)) Result = John **HELP
11 2 =index(b3:b6,match(1&<>"b9&b10",a3:a6,-1)) Result = Dan **HELP
The first formula is to find who has a ranking of 1 or greater, then the second and third formula is where I'm struggling. I need to find who the has the next ranking closest to 1 but has not already been outputted in cell B9. Then the next formula would be the same but not someone that's been outputted in cell B9 & B10. Hopefully this make sense.Thanks!
Use index and aggregate with countif for aggregate's k factor.
=INDEX(B$1:B$6,AGGREGATE(15,6,ROW($3:$6)/(A$3:A$6=A9),COUNTIF(A$9:A9,A9)))

Sum of Vlookups advice

I have a column "Uni"
E.g.
Person Uni Round 1 Round 2 Total Rank
Leia Notts 5 5 10
Hailey Notts 6 5 11
Bobby Bath 8 1 9
James Liverpool 9 1 10
Then another table:
University Total Score Rank
Notts =sum(vlookup(...))
Bath =sum(vlookup(...))
Currently, my formula returns the 'first' lookup of the keyword - e.g. for notts, it returns '10' - rather than looking up the 10 and the 11 and summing them.
How do I make it lookup and sum both values?
My current formula is =sum(vlookup(S7,B$3:Q$40,15,FALSE)) where S7 is "Notts", range, index column 15 is "total score"
There's about 8-10 of each university.
Vlookup only returns one value, you can't sum over that.
Maybe use instead something like
=SUMIF(B$3:B$40,S7,$P3:$P40)

Count and average data inside categories under two types of conditions

I'm working on Excel with a lot of data and I'm having difficulty with knowing how to sort through it to get some important numbers. I have minimal Excel experience.
Right now I'm struggling with knowing how to get the average in the difference between two columns. The trick is that I have to get the average in difference when column A is less that column B and then, the same when it's more. And all that within a category.
So for example let's say I have 3 categories: Football, Soccer, and Basketball (these are just made up ones).
So in column A, I have: Soccer, Football, Basketball. Then, in column B and C, I have the scores for John and Adam for the last 3 months, respectively. Lastly, in column D, I have the differences between their scores.
So, for example:
Category John Adam Differences
Soccer 5 3 2
Soccer 6 2 4
Soccer 3 5 2
Soccer 4 0 4
I want to create a table for within each category I have a table like below:
NÂș of cases Avg. Difference between John and Adam
When John's score is >
When John's score is <
When they are equal
Is there some type of formula where I can say something like this:
If the category is Soccer (the category being in column A), take the difference between John's score (column B) and Adam's score (column C) when John's score is larger than Adam's score, then calculate the average of those differences? Then, I would use the same formula but tweak it when John's score is smaller.
Additionally, would there be a formula where I can also, calculate within the category Soccer, how many times John's score is bigger than Adam's?
My data is much larger and I can't do this manually.
A B C D
1 Sport John Adam Differences
2 Soccer 5 3 2
3 Soccer 6 2 4
4 Soccer 3 5 -2
5 Soccer 4 0 4
6 Basketball 20 15 5
7 Basketball 7 13 -6
8 Basketball 26 10 16
9 Basketball 8 11 -3
Type in D1:
=B1-C1
Drag the formula in Column D to all rows which there are values in columns A, B and C.
Create the PivotTable.
Drag Sport to "Row Label" field. Drag Differences to "Row Label" field under Sport.
Drag Differences to "Values" field as: Count of Differences (same way the previous question)
Drag Differences to "Values" field (below Count of Differences), and set the mathematical operation as "Average" of Differences (left-mouse click Differences, choose "Values fields settings" and select "Average").
Give a right-click mouse in cell A5 (see picture bellow) and select "Group" option.
Set "Starting at" = 0; "Ending at" = 1000; "By" = 1000 (as in the picture below). Click ok.
You will have in each Sport, the count (frequency) and average Differences values for two groups:
When the Difference B1-C1 is negative; and
When the Difference B1-C1 is zero or positive.
The average of Differences when the score is equal will be always zero.

Resources