VBA / performing calcs on a subset of data within an array

msaldut

New Member
Joined
Nov 17, 2014
Messages
8
Is it possible to isolate just a small subset of data within an array?

For example, if i have 100 data points in a single dimension array ("price_array"), I cannot figure out how to get the max, min or average for just 10 at a time.

This doesn't work:
---application.max(range(price_array(1),price_array(10)))

I suspect this would work, but it seems inefficient especially for larger samples:
---application.max(price_array(1), price_array(2), price_array(3), price_array(4), price_array(5), price_array(6), price_array(7), price_array(8),
price_array(9), price_array(10))

Is there a better way to do this? Thanks!
 

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