Display Average of Named Table Column in a Message Box

BrianExcel

Well-known Member
Joined
Apr 21, 2010
Messages
975
I have a named table "PercentEditTable" which has a header row and then a data set for each of two columns. I also have a second table, "PercentEditTable_New", which encompasses just the data set with no header row.

The second row, with header "Percent Edit", I need to do an average of all rows of data in that column and display the average as a % in a messagebox.

How would I do this?
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
I am thinking something along the lines of

VBA Code:
BallEditsNew = WorksheetFunction.Average(Range("PercentEditTable_New[Percent Edit]"))

But when I do this it shows me either a "0" or a blank value. Each of the numbers in the dataset are formatted as "General".
 
Upvote 0
If you format that column as short date, what happens?
 
Upvote 0
It looks like for reason Excel just doesn't like that code. If I use this it works:

VBA Code:
    BallEdits = Application.Average(ActiveSheet.ListObjects(1).ListColumns("Percent Edit").Range)
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,391
Members
448,957
Latest member
Hat4Life

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