Dynamic Scroll Range

A spin button in Excel is a great way to create an interactive and dynamic scrolling range for reports, dashboards, or data analysis. In this tutorial, we’ll walk through how to insert a spin button, link it to a cell, and use it to scroll through data by days, weeks, months, quarters, and years. Let’s do this!

Video

Step-by-step Guide

Step 1: Insert a Spin Button

The first step is to insert a spin button into your worksheet. This button allows users to increment or decrement a value with a simple click.

Enable the Developer Tab

If you don’t see the Developer tab in your ribbon, follow these steps to enable it:

Click the dropdown on the Quick Access Toolbar and select More Commands.

Click Customize Ribbon.

On the right side, scroll down and check Developer.

Click OK.

Now, you should see the Developer tab in your ribbon.

Insert the Spin Button

Go to the Developer tab.

Click Insert and select Spin Button (under Form Controls).

Click and drag anywhere in the worksheet to place the button.

At this point, clicking the button won’t do anything yet. We need to link it to a cell.

Link the Spin Button to a Cell

Right-click the spin button and select Format Control.

Go to the Control tab.

In the Cell link field, enter the cell where you want the value to appear (e.g., C6).

Click OK.

Now, when you click the spin button, the linked cell will update accordingly!

Note: users can still type values into the cell link cell. When you click the spin button, it simply increments the current cell value. Also, there are tons of other spin button options to play with, so definitely check them out by right-clicking and choosing Format Control.

Now that we have a working spin button, let’s use it to dynamically scroll through dates.

Step 2: Create a Dynamic Scroll Range

Scrolling by Days

We’ll start with a simple formula:

In the First report period cell (e.g., C7), our formula will be to add the Year start + the Period offset (which is the cell link for the spin button). This formula calculates the first period based on the year start and the spin button’s value.

Then, for our report headers, we simply point to the first report period cell, and then add one as we fill down (if we want vertical periods) or right (if we want horizontal periods):

Now, as the user clicks the spin button, the Period offset increments, and the period headers update dynamically:

Scrolling by Weeks

To scroll by weeks instead of days:

Right-click the spin button, select Format Control, and change Incremental Change to 7.

Now, the range updates weekly as the spin button is clicked.

Scrolling by Months with the EOMONTH Function

To scroll by months, we use the EOMONTH function, which calculates the last day of a month:

Right-click the spin button, set Incremental Change to 1.

Use this formula for the First report period:

=EOMONTH(C5, C6)

For period headings, use the EOMONTH function again as follows:

=EOMONTH(B12, 1)

Fill this formula down (or right) to extend the series.

Now, clicking the spin button updates the range month by month.

Scrolling by Quarters and Years

To scroll by quarters, set the Incremental Change to 3 and modify the EOMONTH formula to use 3 for the second argument (advances the date by 3 months).

To scroll by years, set the Incremental Change to 12, and modify the EOMONTH formula to use 12 for the second argument (advances the date by 12 months).

Step 3: Creating a Dynamic Report with SUMIFS

Now that our spin button updates the period range, let’s calculate values dynamically.

Here is the data we’d like to summarize (and it is stored in a Table named Table1):

Using SUMIFS for Dynamic Data Aggregation

We’ll set up our spin button and report headers using the monthly technique as illustrated above.

For the report values, we’ll use SUMIFS to sum values based on selected periods.

In the values column, enter:

=SUMIFS(Table[Amount], Table[Region], $B10, Table[Period], C$10)

  • Table[Amount] – The column containing the values to sum.
  • Table[Region] – The column where we check the first condition (Region).
  • $B10 – The specific region to filter (locked column for copying right).
  • Table[Period] – The column where we check the second condition (Period).
  • C$10 – The specific period to filter (locked row for copying down).

Before filling the formula down and right, double-check to ensure you use the following cell reference styles:

  • Lock the header row with $10.
  • Lock the region column with $B.

Fill the formula down and then copy → paste right (instead of dragging the fill handle right).

Now, clicking the spin button automatically updates the report’s values!

Final Thoughts

Using a spin button to create a dynamic scroll range is a fantastic way to make Excel reports interactive and user-friendly. Whether you’re scrolling through days, weeks, months, quarters, or years, this technique can enhance data analysis and reporting.

Try it out, and let me know how it works for you! Have any questions? Drop them in the comments below.

Sample File

FAQs

1. How do I enable the Developer tab in Excel?

Go to File → Options → Customize Ribbon and check Developer. Click OK.

2. What is the purpose of the EOMONTH function?

EOMONTH(start_date, months) returns the last day of a month, making it useful for monthly, quarterly, or yearly scrolling.

3. Why is my spin button not changing values?

Check that the cell link is set correctly in Format Control and that incremental change is not zero.

4. Can I use a spin button to scroll through other data types?

Yes! You can link it to any numerical data, including prices, sales, inventory counts, and even text-based index numbers.

5. Can I make the scroll range horizontal instead of vertical?

Yes! Use the same formulas but adjust them to reference the cell to the left instead of above.

6. How do I reset the scroll range to the start?

Manually set the linked cell value to zero.

Posted in , ,

Jeff Lenning

I love sharing the things I've learned about Excel, and I built Excel University to help me do that. My motto is: Learn Excel. Work Faster.

Excel is not what it used to be.

You need the Excel Proficiency Roadmap now. Includes 6 steps for a successful journey, 3 things to avoid, and weekly Excel tips.

Want to learn Excel?

Our training programs start at $29 and will help you learn Excel quickly.

Leave a Comment