Embedded Range or Array Lookup

Gimics

Board Regular
Joined
Jan 29, 2014
Messages
164
Office Version
  1. 365
Platform
  1. Windows
Hey pro team,

I'm looking for advice to solve two lookup-related challenges from the same data set. I've started a fantasy league for Formula 1 with some friends and would like to capture the results of our scoring pool for each race. I've created a tracker spreadsheet that lists our "Players", their "Picks", and the scores of their picks. What I would like to do with two separate formulas is 1: Lookup and return the Pick with the most points from that race week, and 2: Lookup and return the Player with the most points from that race week.

Here's an example of how the data is structured:
ABCD
1RacePlayerPickPoints
2BahrainDwightVER10
3BahrainJimPER15
3BahrainMichaelLEC0
4BahrainDwightSAI5
5BahrainJimRUS8
6BahrainMichaelALO6
7
8SaudiDwightLEC15
9SaudiJimVER10
10SaudiMichaelPER5
11SaudiDwightSAI8
12SaudiJimALO6
13SaudiMichaelRUS12

And here's a table of the results summary where I am looking for help with the formulas:
ABC
1RacePlayer WinnerPick Winner
2BahrainFormula 2 (Result: Jim)Formula 1 (Result: PER)
3SaudiFormula 2 (Result: Dwight)Formula 1 (Result: LEC)

Formula 1: Pick Winner - Just need a simple way of looking up which "Pick" driver had the most (Max) points for each race. Would need to lookup the race (ex. "Bahrain"), then fine the max value in column "D" and return the "Pick".
The result for C2 should be PER and the result for C3 should be LEC.

Formula 2: Player Winner - Similar to Formula 1, but need to "sum" the points received for each Player, THEN apply the "Max" formula to find the most points, THEN return the Player name.
The result for B2 should be Jim, and the result for B3 should be Dwight.

Would be amazing to find a way to do this in a single formula, instead of with helper tables or columns - but I know that's going to be challenging.

Thanks in advance!
 
Last edited:

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
How about
Fluff.xlsm
ABCD
1RacePlayerPickPoints
2BahrainDwightVER10
3BahrainJimPER15
4BahrainMichaelLEC0
5BahrainDwightSAI5
6BahrainJimRUS8
7BahrainMichaelALO6
8
9SaudiDwightLEC15
10SaudiJimVER10
11SaudiMichaelPER5
12SaudiDwightSAI8
13SaudiJimALO6
14SaudiMichaelRUS12
15
16
17
Sheet1


Fluff.xlsm
ABC
1RacePlayer WinnerPick Winner
2BahrainJimPER
3SaudiDwightLEC
4
Sheet2
Cell Formulas
RangeFormula
B2:C3B2=TAKE(SORT(FILTER(Sheet1!$B$2:$D$200,Sheet1!$A$2:$A$200=A2),3,-1),1,2)
Dynamic array formulas.
 
Upvote 0
Thanks Fluff - I don't see any summation happening for Formula 2 (Player Winner) though; I think your "sort" is just finding Jim and Dwight because they picked the first-place driver - perhaps I should tweak the data also that the Player whose Pick came in first place, isn't necessarily the winner for the week.

Below I've adjusted the scoring slightly so that in Bahrain Dwight picked the first place driver, but Jim actually has the highest points overall. The formula should return "Jim" for Bahrain, but it doesn't:
Book1
ABCD
1RacePlayerPickPoints
2BahrainDwightVER15
3BahrainJimPER10
4BahrainMichaelLEC5
5BahrainDwightSAI0
6BahrainJimRUS8
7BahrainMichaelALO6
8
9SaudiDwightLEC15
10SaudiJimVER10
11SaudiMichaelPER5
12SaudiDwightSAI8
13SaudiJimALO6
14SaudiMichaelRUS12
15
16
17RacePlayer WinnerPick Winner
18BahrainDwightVER
19SaudiDwightLEC
Sheet1
Cell Formulas
RangeFormula
B18:C19B18=TAKE(SORT(FILTER(Sheet1!$B$2:$D$14,Sheet1!$A$2:$A$14=A18),3,-1),1,2)
Dynamic array formulas.
 
Upvote 0
Ok, how about
Fluff.xlsm
ABCDEFGH
1RacePlayerPickPointsRacePlayer WinnerPick Winner
2BahrainDwightVER15BahrainJimVER
3BahrainJimPER10SaudiDwightLEC
4BahrainMichaelLEC5
5BahrainDwightSAI0
6BahrainJimRUS8
7BahrainMichaelALO6
8
9SaudiDwightLEC15
10SaudiJimVER10
11SaudiMichaelPER5
12SaudiDwightSAI8
13SaudiJimALO6
14SaudiMichaelRUS12
15
Sheet1
Cell Formulas
RangeFormula
G2:G3G2=LET(u,UNIQUE(FILTER($B$2:$B$100,$A$2:$A$100=F2)),TAKE(SORT(HSTACK(u,SUMIFS(D:D,A:A,F2,B:B,u)),2,-1),1,1))
H2:H3H2=TAKE(SORT(FILTER($C$2:$D$100,$A$2:$A$100=F2),2,-1),1,1)
 
Upvote 0
Ok, how about
Fluff.xlsm
ABCDEFGH
1RacePlayerPickPointsRacePlayer WinnerPick Winner
2BahrainDwightVER15BahrainJimVER
3BahrainJimPER10SaudiDwightLEC
4BahrainMichaelLEC5
5BahrainDwightSAI0
6BahrainJimRUS8
7BahrainMichaelALO6
8
9SaudiDwightLEC15
10SaudiJimVER10
11SaudiMichaelPER5
12SaudiDwightSAI8
13SaudiJimALO6
14SaudiMichaelRUS12
15
Sheet1
Cell Formulas
RangeFormula
G2:G3G2=LET(u,UNIQUE(FILTER($B$2:$B$100,$A$2:$A$100=F2)),TAKE(SORT(HSTACK(u,SUMIFS(D:D,A:A,F2,B:B,u)),2,-1),1,1))
H2:H3H2=TAKE(SORT(FILTER($C$2:$D$100,$A$2:$A$100=F2),2,-1),1,1)
Thanks again Fluff - this definitely works, but I've never used TAKE() LET() UNIQUE() or HSTACK() before .. and some of these appear to be newer functions that aren't working on older versions of Excel that my friends (the "Players" use)?

Any thoughts on using any more common formulas, before I mark your response as the solution?
 
Upvote 0
It just depends what version of Excel they are using.
 
Upvote 0

Forum statistics

Threads
1,213,487
Messages
6,113,938
Members
448,534
Latest member
benefuexx

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top