Pushing a 'slider' to the limit

naquinn

Board Regular
Joined
Mar 5, 2009
Messages
55
Hello everyone,

I have a question about sliders.

I have a column with different values in it, all numbers. I have a separate cell that calculates a range within that column. Say for example, =Average(A1:A12)

Ok, my question is, can I design some sort of 'slider' that expands or contracts the range that this simple average formula is looking at? So by moving the slider a number of clicks, the formula suddenly becomes =Average(A1:A20)

My head hurts from trying to work this one out. Someone, said it might be possible with VBA? But no idea what this means.

Anyway, help, solutions, or pointers in the right direction would be very very gratefully received!

Many thanks to you all!

nick (london)
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
From the Forms toolbar insert a scrollbar onto the worksheet surface.

Right click the control and select Format Control... Set the linked cell to a cell that will contain the row number of the last cell of interest. I chose B3. In B2, I entered 1, the row number of the first cell of interest.

Then, in some cell enter the formula =AVERAGE(INDIRECT("A"&B2&":A"&B3))

That's it. You are done.

Right click the control and select Format Control... to adjust the different parameters. I'd set the min. value to 1 (rather than the default 0) and the max. value to whatever is appropriate to your model.
 
Upvote 0

Forum statistics

Threads
1,214,389
Messages
6,119,232
Members
448,879
Latest member
VanGirl

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