Finding averages inside a named 1-dimensional range

RawlinsCross

Active Member
Joined
Sep 9, 2016
Messages
437
I have a named range (rYvalues) which is a singe column. It can be of variable length (7 to 365). If I want to take an average of a continuous section of that 1-dimensional named range, say average positions 50 to 99, how might I be able to do that? I've been all the web on this one and finding it hard to figure out. Can I work directly with the named range or do I have to set a new Range that is a section of the named range?

I've tried something along the lines of this:

Code:
 dAverage = Application.WorksheetFunction.Average(rYvalues.Range(Cells(50), Cells(99)))
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Try
Code:
Application.WorksheetFunction.Average(Range(ryvalues.Cells(50), ryvalues.Cells(99)))
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,161
Members
453,021
Latest member
Justyna P

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