0

Here is a challenge for everyone. I am looking for a list of players that are scoring below 10 pts OR shooting less than 41% from the field. Also, in a separate chart, I am looking for the top 3 scorers from each league.

ex. Basketball Stats

Basketball Stats

Also, I am attaching a Google Docs link so everyone can try. It will be a great help if someone was able to figure this out. Thanks.

2
  • What constitutes a top score? highest/lowest pts or FG %??
    – teylyn
    Commented Sep 5, 2019 at 2:40
  • For points, higher the number will be considered as the highest points
    – Steve
    Commented Sep 5, 2019 at 2:54

2 Answers 2

2

With traditional Array formulas you can use the following:

in cell F3 (this is an array formula and must be confirmed with Ctrl+Shift+Enter)

=IFERROR(INDEX(A$2:A$31,SMALL(IF(($C$2:$C$31<10)+($D$2:$D$31<41),ROW($A$1:$A$30)),ROW(A1))),"")

Copy across to column I and down to row 31.

In cell K3 (this is an array formula and must be confirmed with Ctrl+Shift+Enter)

=INDEX($A$2:$A$31,MATCH(K$2&LARGE(IF($B$2:$B$31=K$2,$C$2:$C$31),ROW(A1)),INDEX($B$2:$B$31&$C$2:$C$31,0),0))

Copy across to M3 and down to the following two rows.

enter image description here

** Edit: ** If there are different conditions for each league, you can work these into the IF() statement. In an Array formula you cannot use the AND() or OR() formulas to combine conditions. Instead, each condition will be put inside brackets and combined with * for AND and + for OR.

The logic in words is

((League=A) AND ((PTS<10) OR (FG<41))) OR
((League=B) AND ((PTS<15) OR (FG<50))) OR
((League=C) AND ((PTS<15) OR (FG<50)))

In the formula that would then look like

(($B$2:$B$31="A")*(($C$2:$C$31<10)+($D$2:$D$31<41)))+
(($B$2:$B$31="B")*(($C$2:$C$31<15)+($D$2:$D$31<50)))+
(($B$2:$B$31="C")*(($C$2:$C$31<15)+($D$2:$D$31<50)))

The complete formula is then (remember Ctrl-Shift-Enter)

=IFERROR(INDEX(A$2:A$31,SMALL(IF(
(($B$2:$B$31="A")*(($C$2:$C$31<10)+($D$2:$D$31<41)))+
(($B$2:$B$31="B")*(($C$2:$C$31<15)+($D$2:$D$31<50)))+
(($B$2:$B$31="C")*(($C$2:$C$31<15)+($D$2:$D$31<50))),
ROW($A$1:$A$30)),ROW(A1))),"")

The same condition logic and architecture would apply to the Dynamic Array Filter() function in my other answer.

3
  • Teylyn, THANK YOU SO MUCH! I really appreciated your help!
    – Steve
    Commented Sep 5, 2019 at 5:51
  • I added the more complex filtering to my answer.
    – teylyn
    Commented Sep 5, 2019 at 20:53
  • Wow thank you so much Teylyn!
    – Steve
    Commented Sep 6, 2019 at 4:23
2

This is a prime example for the new Excel Dynamic Array functions, which are currently available only in Office Insider builds.

One (ONE!) formula in cell F3 goes like this:

=FILTER($A$2:$D$31,($C$2:$C$31<10)+($D$2:$D$31<41))

It automatically extends to the right and down.

Another formula in cell K3. I changed the cells K2 to M2 to have the same text as column B.

=INDEX(SORTBY(FILTER($A$2:$A$31,$B$2:$B$31=K2),FILTER($C$2:$C$31,$B$2:$B$31=K2),-1),{1;2;3})

This has been copied to L3 and M3, but nothing has been copied down.

(note: if your system uses semicolons in Excel formulas, you need to swap the commas for semicolons and the semicolons for commas)

enter image description here

5
  • Can this be done without using the new Dynamic Array function?
    – Steve
    Commented Sep 5, 2019 at 3:22
  • Yes, but it will be a lot more complex, using array formulas and helper columns. Are you open to that?
    – teylyn
    Commented Sep 5, 2019 at 3:33
  • Yes that would be much better for me. Thank you!
    – Steve
    Commented Sep 5, 2019 at 3:54
  • Teylyn, how would you change the formula, IF criteria changes for each league. So under "list of players scoring less than 10 pts or shooting below 41%", this criteria would be only for league A, and League B & C have criteria of "list of players scoring less than 15 pts or shooting below 50%". Is it possible to have all of this in one formula?
    – Steve
    Commented Sep 5, 2019 at 10:02
  • Yes, but it will be a long formula. Which approach do you need, new Dynamic Arrays or Ctrl-Shift-Enter formulas? I'll put it into the regular Array answer, but it can also be applied to Dynamic Array Filter().
    – teylyn
    Commented Sep 5, 2019 at 20:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .