JenniferMurphy
Well-known Member
- Joined
- Jul 23, 2011
- Messages
- 2,691
- Office Version
- 365
- Platform
- Windows
I have a sheet with the rankings of the 32 NFL teams. The rankings are based on the average of the rankings from several sports ranking websites. The overall ranking works. But I would like to be able to calculate the rank of each team withih its conference of 16 teams and its division of 4 teams. I have tested several formulas using various combinations of Rank, Filter, Index, but I either get a Spill error or Excel tells me that what I entered is not a formula.
In the minisheet below, the formulas in B8 & C8 work, but what I think is a comparable expression inside the table (F8) gets a Spill error. I entered the values in the Rank in Division column (G) manually to show what the result should be when the table is sorted by Division within Conference within Rank.
Can someone tell me what I am doing wrong and how to fix it?
I have macros that will sort the table.
In the minisheet below, the formulas in B8 & C8 work, but what I think is a comparable expression inside the table (F8) gets a Spill error. I entered the values in the Rank in Division column (G) manually to show what the result should be when the table is sorted by Division within Conference within Rank.
Can someone tell me what I am doing wrong and how to fix it?
I have macros that will sort the table.
VBA Code:
'==================================================================
' Sort #1 - Rank
'==================================================================
Sub SortByRank()
With ActiveSheet.Sort
.SortFields.Clear
.SortFields.Add Key:=Range("TblNFL[Rank Overall]"), Order:=xlAscending
' .SetRange Range("TblNFL") 'This caused problems
.SetRange ActiveSheet.ListObjects("TblNFL").Range
.Header = xlYes
.Apply
End With
End Sub
'==================================================================
' Sort #2 - Conference, Rank
'==================================================================
Sub SortByConferenceRank()
With ActiveSheet.Sort
.SortFields.Clear
.SortFields.Add Key:=Range("TblNFL[Conference]"), Order:=xlDescending
.SortFields.Add Key:=Range("TblNFL[Rank Overall]"), Order:=xlAscending
' .SetRange Range("TblNFL") 'This caused problems
.SetRange ActiveSheet.ListObjects("TblNFL").Range
.Header = xlYes
.Apply
End With
End Sub
'==================================================================
' Sort #3 - Conferene, Division, Rank
'==================================================================
Sub SortByConferenceDivisionRank()
With ActiveSheet.Sort
.SortFields.Clear
.SortFields.Add Key:=Range("TblNFL[Conference]"), Order:=xlDescending
.SortFields.Add Key:=Range("TblNFL[Division]"), Order:=xlDescending
.SortFields.Add Key:=Range("TblNFL[Rank Overall]"), Order:=xlAscending
' .SetRange Range("TblNFL") 'This caused problems
.SetRange ActiveSheet.ListObjects("TblNFL").Range
.Header = xlYes
.Apply
End With
End Sub
2024 NFL Power Rankings.xlsm | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | |||
6 | R/C | B | C | D | E | F | G | H | I | J | K | ||
7 | 7 | Rank Overall | Rank in Conference | Rank in Division | Team | Conference | Division | Wk 14 Average Rank | |||||
8 | 8 | TRUE | TRUE | 13 | #SPILL! | 1 | Seattle Seahawks | NFC | West | 13.8 | |||
9 | 9 | TRUE | TRUE | 15 | #SPILL! | 2 | Arizona Cardinals | NFC | West | 14.2 | |||
10 | 10 | TRUE | TRUE | 16 | #SPILL! | 3 | San Francisco 49ers | NFC | West | 16.4 | |||
11 | 11 | TRUE | TRUE | 17 | #SPILL! | 4 | Los Angeles Rams | NFC | West | 16.6 | |||
12 | 12 | TRUE | TRUE | 14 | #SPILL! | 1 | Tampa Bay Buccaneers | NFC | South | 14.1 | |||
13 | 13 | TRUE | TRUE | 20 | #SPILL! | 2 | Altanta Falcons | NFC | South | 19.3 | |||
14 | 14 | TRUE | TRUE | 24 | #SPILL! | 3 | New Orleans Saints | NFC | South | 23.9 | |||
15 | 15 | TRUE | TRUE | 27 | #SPILL! | 4 | Carolina Panthers | NFC | South | 26.8 | |||
16 | 16 | TRUE | TRUE | 1 | #SPILL! | 1 | Detroit Lions | NFC | North | 1.1 | |||
17 | 17 | TRUE | TRUE | 5 | #SPILL! | 2 | Green Bay Packers | NFC | North | 5.6 | |||
18 | 18 | TRUE | TRUE | 6 | #SPILL! | 3 | Minnesota Vikings | NFC | North | 5.9 | |||
19 | 19 | TRUE | TRUE | 22 | #SPILL! | 4 | Chicago Bears | NFC | North | 22.3 | |||
Power rankings |
Cell Formulas | ||
---|---|---|
Range | Formula | |
B6:K6 | B6 | =col() |
B8:B39 | B8 | =TblNFL[Conference]=I8 |
C8:C39 | C8 | =TblNFL[Conference]=TblNFL[@Conference] |
E8:E19 | E8 | =RANK.EQ([@[Wk 14 Average Rank]],[Wk 14 Average Rank],1) |
F8:F19 | F8 | =[Conference]=[@Conference] |
A7:A19 | A7 | =ROW() |
K8:K19 | K8 | =AVERAGE([@[Wk 14 NFL]]:OFFSET([@[Wk 14 Record]],0,-1)) |
Dynamic array formulas. |