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

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
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,214,412
Messages
6,119,365
Members
448,888
Latest member
Arle8907

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