Michael Liew
Michael Liew

Reputation: 337

Complex nested array in Excel

I'm trying to do a scoresheet lookup in Excel, and want to do it without vba.

Mainly so that the spreadsheet can be used in either Mac or Windows without issue, and also to give the score sheet a "live" feel to it with the updates happening in real time.

What I have so far is:

IMG1

And using the array formula

{=MAX(IF(B2:B18=F1,C2:C18))}

I can return the best score for team 1 (93)

However although Team 1 can have as many competitors as they want, only nominated competitors scores register.

And as Felix is not a nominated competitor (only the four listed in cells F2 - F5 are)

The best score for Team 1 should be Ryan's score of 64.

So my conundrum is, I want to return the max score (like my formula already does) with the condition that the competitors name is in the Team list in column F.

I've been messing around no luck and am wondering if this is even possible without vba coding.

Many Thanks

Michael

Upvotes: 0

Views: 985

Answers (3)

Ron Rosenfeld
Ron Rosenfeld

Reputation: 60174

You can use this array-entered function:

=MAX(($A$2:$A$18=TRANSPOSE(F2:F5))*($B$2:$B$18=F1)*$C$2:$C$18)

To enter/confirm an array formula, hold down ctrl + shift while hitting enter. If you do this correctly, Excel will place braces {...} around the formula seen in the formula bar.

enter image description here

Note that I chose to also check that the nominated competitor is in the requisite team, just in case you have two people with the same name on different teams. But that is not necessary.

NOTE: AGGREGATE function solution removed as it did not work properly.

Upvotes: 1

QHarr
QHarr

Reputation: 84465

You could also use

=MAX(IF(ISNUMBER(SEARCH(F2:F5,A2:A18)),IF(B2:B18=F1,C2:C18)))

Enter with Ctrl+Shift+Enter

Upvotes: 0

Michal
Michal

Reputation: 5750

enter image description here

 =MAX(IF(Scores[Team]=E1,Scores[Score])*(Scores[Competetitor]=TRANSPOSE(Team1[Team 1])))

Upvotes: 0

Related Questions