• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member
  • Login

Excel Scroll and Sort Table

You are here: Home / Excel Charts / Excel Scroll and Sort Table
June 13, 2023 by Mynda Treacy

Dashboards have limited space which is why an Excel scroll and sort table is super handy.

Scroll and sort tables allow you to embed an extract of data from a larger table in your Dashboard.

Users can scroll to see all the records and toggle which column to sort by and set the sort order, as shown below:

Excel scroll and sort table


Subscribe YouTube

Download Workbook

Enter your email address below to download the sample workbook.

By submitting your email address you agree that we can email you our Excel newsletter.
Please enter a valid email address.

Download the Excel Workbook. Note: This is a .xlsx file. Please ensure your browser doesn't change the file extension on download.

Note, this workbook contains functions that are only available to Excel 2021 and 365 users.

Creating an Excel Scroll and Sort Table

Before we had the luxury of Dynamic Arrays, creating an Excel scroll and sort table was a complex task.

It required multiple tables, formulas and helper columns, which I cover in detail in my Excel Dashboard course.

But in this tutorial I want to show you how simple it is to create a scroll and sort table using the new Dynamic Array functions and functionality.

To be clear, the techniques in this tutorial will only work in Excel 2021 and 365 where you have the new Dynamic Array functions.

Source Data

My 20 rows of source data is stored in an Excel Table called ‘Stock’:

excel scroll and sort data source

Formatting your data in an Excel Table isn’t strictly necessary, but it makes it quick and easy to write my formulas using the Table’s Structured References.

Excel Scroll and Sort Table Form Controls

The sort column and sort order are controlled using Radio Buttons and I used a Scroll Bar for the scrolling of the table.

excel form controls

Radio Buttons and Scroll Bars are Form Controls that allow the user to interact with your worksheet.

Note: the up/down triangles are Symbols inserted in the cell.

Form Controls are found on the Developer tab:

excel developer tab

If you don’t see the Developer tab, read this article for instructions how to enable it: Enable the Developer Tab in Excel.

The selection made in a Form Control is returned to a cell that you specify by right-clicking on the Form Control > Format Control > Cell Link:

excel form control cell link

You can see the Form Control selection results in the image below where the Sort Order button is displayed in cell H3, the Sort By is in cell H4 and the scroll bar position is in cell H5.

These results can also be hidden on another sheet. I've included them beside the table so you can see them in context:

excel form control output

When you place the Radio Buttons inside a Group Box, like I’ve done above, each button is given a number.

For example, the first 'Order' Radio Button is selected and cell H3 contains 1. Likewise, the second 'Sort By' Radio Button is selected and cell H4 contains 2.

The Scroll Bar shows position 9 because it's scrolled almost to the bottom.

Tip: the whole Radio Button frame must be inside the Group Box for it to form part of the group. If the outer edge of the Radio Button is outside the Group Box, it won’t be included.

excel form control alignment

Excel Scroll and Sort Table Formula

The table contains a single formula that detects the selections made in the Form Controls and returns an extract of the source data accordingly.

It uses the INDEX, SORT, CHOOSE and SEQUENCE functions. They are linked to named cells for Order (H3), Sortby (H4) and Scroll (H5):

=INDEX( SORT(Stock, SortBy, CHOOSE(Order,1,-1)), SEQUENCE(10,1,Scroll+1,1), {1,2,3,4,5})

In English it reads:

  • SORT the tabled called Stock by the 'Sort By' column number displayed in cell H4 named SortBy,
  • use CHOOSE* to return 1 for ascending and -1 for descending based on the order specified in cell H3 named Order,
  • INDEX the table returned by SORT,
  • returning 10 rows starting at the row number in cell H5 named Scroll +1 and increment by 1,
  • and return columns 1 through 5.

And because it’s a dynamic array formula it spills the results to create a table 10 rows high and 5 columns wide:

Excel Scroll and Sort Table formula

*The SORT function requires 1 for ascending order and -1 for descending order.

The Radio buttons return 1 for ascending and 2 for descending, so we use CHOOSE to return the correct value for the SORT function.

Alternatively you could use SWITCH(Order,1,1,2,-1) to achieve the same result.

Conditional Formatting

The final touch is to add a conditional formatting formula to highlight the selected ‘Sort by’ column.

excel conditional formatting

Related Tutorials

I realise that you may not have access to dynamic array functions yet, but there are many other ways you can use Form Controls in earlier versions of Excel.

Below are a few tutorials you might like to check out:

Form Controls

Toggle Conditional Formatting On and Off using Form Controls

Interactive Excel Charts

Excel Chart Highlighting
 

Please Share

If you liked this please share this tutorial with your friends and colleagues.

Mynda Treacy

Microsoft MVP logo

AUTHOR Mynda Treacy Co-Founder / Owner at My Online Training Hub

CIMA qualified Accountant with over 25 years experience in roles such as Global IT Financial Controller for investment banking firms Barclays Capital and NatWest Markets.

Mynda has been awarded Microsoft MVP status every year since 2014 for her expertise and contributions to educating people about Microsoft Excel.

Mynda teaches several courses here at MOTH including Excel Expert, Excel Dashboards, Power BI, Power Query and Power Pivot.

More Excel Charts Posts

interactive python charts in excel

Interactive Python Charts in Excel

How to build interactive Python Charts in Excel and regular charts with Slicers connected to data from Power Query.
Circle Progress Charts

Excel Progress Circle Charts

How to easily create dynamic Excel Progress Circle Charts, using doughnut charts and some wizardry, including Slicers to change the data.
professional vs amateur chart formatting

Pro Excel Chart Formatting

10 tell-tale signs that show you’re a chart amateur and the Excel chart formatting you should use instead.
picture fill excel charts

Picture Fill Excel Charts

Using a stylish picture fill in your Excel Charts is a simple way to make your data visualizations more captivating and memorable
excel speedometer charts

Excel Speedometer Charts

How to build Excel Speedometer Charts or Gauge Charts as they're also know, why they are BAD and what to use instead.
burn up burn down charts

Excel Project Management Burn Down and Burn Up Charts

Excel Burn Down and Burn Up Charts are easy to make with line or scatter charts. They are useful for monitoring the progress of a project.
wee people font charts

Excel WeePeople Font Charts

Excel WeePeople Font Charts are a nice change from generic shapes for waffle charts, bar/column charts and more.
excel dot map charts

Excel Dot Map Charts

Interactive Excel dot map charts are not built-in, but with some creative use of Excel’s built-in tools we can create something unique.
Excel S Curve Charts

Excel S-Curve Charts

Easy Excel S-curve Charts made with PivotTables for project management. Track progress by including budget amounts.
chart axis switch

Excel Chart Axis Switch

Use radio button form controls to create an Excel chart axis switch enabling you to toggle pannel charts between same axis and own axis.


Category: Excel Charts
Previous Post:10 mistakes to avoid when using excel formatting10 Mistakes to Avoid With Excel Formatting
Next Post:Center Across Selection Macromacro to center across selection

Reader Interactions

Comments

  1. Nariman Karimi

    June 17, 2023 at 2:32 pm

    Hi Mynda,
    this is a great tool.. thanks.. My excell skills are very limited, and I would like to use this template in various scenarios, I presume that I can populate the “stock” table with my data which may be more than 20 items?

    Reply
    • Mynda Treacy

      June 17, 2023 at 7:53 pm

      Yes, you can modify the stock table for your needs. You’ll need to modify the scroll bar maximum to suit the size of your data.

      Reply
  2. another jim

    February 11, 2019 at 6:40 pm

    Hi Mynda et al,
    this really is so clever and imginative!
    unfortunately I don’t have this functionality yet to have a play with; so please tell me this:

    why can’t you use another SEQUENCE in the INDEX function instead of {1,2,3,4,5,6} for the column refs?

    I might have used 3-2*$I$3 instead of the CHOOSE function, but there’s no effective difference

    jim

    Reply
    • Mynda Treacy

      February 11, 2019 at 9:02 pm

      Hi Jim,

      Glad you like it 🙂

      You can use another SEQUENCE for the column array if you want, but since I didn’t need it to be dynamic I used an array constant.

      Mynda

      Reply
    • the other jim again

      June 14, 2023 at 8:49 pm

      I do now; I just wish I had a chance to use it (I’ll make one)

      jim

      Reply
      • Mynda Treacy

        June 15, 2023 at 11:28 am

        Great to hear!

        Reply
  3. Jim Compton

    February 10, 2019 at 12:01 am

    This is a great lesson/tool. I have used these methods in creating a summary report with several KPIs to the upper management (for a client). They were very impressed (wow factor !!) and went on to use the report for their management meetings! It was a little tricky to get set up initially (before dynamic arrays) but well worth the effort. Excellent!

    Reply
    • Mynda Treacy

      February 10, 2019 at 8:22 am

      Thanks, Jim. Glad you’ll be able to use it.

      Reply
  4. Søren V. Lund

    February 9, 2019 at 1:35 am

    Hi Mynda
    I placed in Denmark and only get #NAME? in the area A6 to O15.
    {=INDEX(_xlfn._xlws.SORT(Table1,I4,CHOOSE(I3,1,-1)),_xlfn.SEQUENCE(10,1,I5+1,1),{1,2,3,4,5,6})}

    I have this
    =INDEX($A$2:$A$4,MATCH(A6,$B$2:$B$4,0))
    from https://www.contextures.com/xlFunctions03.html
    Works fine.

    Any idea?

    BR Søren

    Reply
    • Catalin Bombea

      February 9, 2019 at 1:46 pm

      Hi Søren,
      As noted in the article,
      “At the time of writing Dynamic Arrays are only available in Office 365 and are currently in beta on the Insiders channel. We don’t have an ETA for when they will be available to all Office 365 users yet.”
      If a function is not available in your excel version, it will receive that prefix: _xlfn

      Reply
    • Mynda Treacy

      February 9, 2019 at 2:53 pm

      Hi Søren,

      As Catalin mentioned, the xlfn prefix is inserted when you don’t have the function in your version of Excel.

      The INDEX & MATCH formula you provided wont’ respond to changes in the sort order or sort by column. This is where the new SORT and SEQUENCE functions come into play.

      Mynda

      Reply
  5. Roger Govier

    February 7, 2019 at 11:50 pm

    Hi Mynda

    Absolutely superb use of the new Dynamic Array functionality to show a sorted subset of your data on a dashboard.
    I love your clever use of the form controls to change Sort direction and Sort column and the use of the Slider bar for determining the start position.
    This will be useful for a lot of people.
    Thanks for sharing.

    Reply
    • Mynda Treacy

      February 8, 2019 at 9:36 am

      Thanks for your kind words, Roger! It’s a honour to hear from a fellow MVP.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Current ye@r *

Leave this field empty

Sidebar

More results...

Popular Content

  • 10 Common Excel Mistakes to Avoid
  • Top Excel Functions for Data Analysts
  • Secrets to Building Excel Dashboards in Less Than 15 Minutes
  • Pro Excel Formula Writing Tips
  • Hidden Excel Double-Click Shortcuts
  • Top 10 Intermediate Excel Functions
  • 5 Pro Excel Dashboard Design Tips
  • 5 Excel SUM Function Tricks
  • 239 Excel Keyboard Shortcuts

100 Excel Tips and Tricks eBook

Download Free Tips & Tricks

239 Excel Keyboard Shortcuts

Download Free PDF

mynda treacy microsoft mvpHi, I'm Mynda Treacy and I run MOTH with my husband, Phil. Through our blog, webinars, YouTube channel and courses we hope we can help you learn Excel, Power Pivot and DAX, Power Query, Power BI, and Excel Dashboards.

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel Office Scripts
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook

Sign up to our newsletter and join over 400,000
others who learn Excel and Power BI with us.

 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate
  • Sponsor Our Newsletter

Support

  • Contact
  • Forum
  • Helpdesk – For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.

Download A Free Copy of 100 Excel Tips & Tricks

excel tips and tricks ebook

We respect your privacy. We won’t spam you.

x