How to make a table include new columns in a row average?

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
2,532
Office Version
  1. 365
Platform
  1. Windows
The table below calculates the composite rankings of the teams in the NFC playoffs based on the averages of several different rankings. My formula in the Ave column uses literal column addresses. If I find another ranking (Rtg4) and add a new column, I have to edit the formula.

Tables.xlsx
CDEFGH
5TeamRankAveRtg1Rtg2Rtg3
649ers11.0000111
7Lions22.6667224
8Eagles33.3333442
9Packers44.0000363
10Buccaneers54.6667635
11Rams65.3333556
12Cowboys77.0000777
Expandable Col Aves
Cell Formulas
RangeFormula
D6:D12D6=RANK.EQ([@Ave],[Ave],1)
E6:E12E6=AVERAGE([@Rtg1]:[@Rtg3])


In this table, I added a dummy last column so I could use Offset for an average formula that automatically adjusts for any new columns. Is there a better way that does not need a dummy column?

Tables.xlsx
BCDEFGHIJ
5TeamRankAve1Ave2Rtg1Rtg2Rtg3Rtg4xxx
649ers11.00001.00001111
7Lions22.66672.75002243
8Eagles33.33334.00004426
9Packers44.00003.50003632
10Buccaneers54.66674.50006354
11Rams65.33335.25005565
12Cowboys77.00007.00007777
Expandable Col Aves
Cell Formulas
RangeFormula
C6:C12C6=RANK.EQ([@Ave1],[Ave1],1)
D6:D12D6=AVERAGE([@Rtg1]:[@Rtg3])
E6:E12E6=AVERAGE(OFFSET([@Ave2],0,1):OFFSET([@xxx],0,-1))


Thanks
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
How about
Excel Formula:
=AVERAGE(DROP(Table1[@],,XMATCH(Table1[[#Headers],[Ave]],Table1[#Headers])))
Change the table name to suit.
 
Upvote 0
Solution
How about
Excel Formula:
=AVERAGE(DROP(Table1[@],,XMATCH(Table1[[#Headers],[Ave]],Table1[#Headers])))
Change the table name to suit.

Wow!!! Elegant and effective. Very nice. Thanks
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
The Drop function in your example drops the first 4 columns from the table. Is there a slightly different formula that drops the first n and the last m columns in a table? Or is there an Include or Keep function that will keep a variable number of columns in the middle of a table?
 
Upvote 0
You can replace the xmatch function with a the number of columns you want to drop from the start of the table & wrap it in another DROP where you can give it a -ve number to drop the last m columns.
 
Upvote 0
If all your rating columns start with Rtg couldn't you just use:

Excel Formula:
=AVERAGEIF(Table1[#Headers],"Rtg*",Table1[@])
 
Upvote 0

Forum statistics

Threads
1,215,068
Messages
6,122,950
Members
449,095
Latest member
nmaske

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