• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Microsoft Excel Tips and Tricks - Computergaga

  • Home
  • Excel Online Courses
  • Excel Functions List
  • Free Downloads
  • Blog
  • Tutorials
  • About
Home / Formulas / Shrinking Drop-Down List using Dynamic Array Formulas

Shrinking Drop-Down List using Dynamic Array Formulas

Shrinking drop-down list in Excel with dynamic array formulas

In this tutorial, we will create a shrinking drop-down list using the dynamic array formula engine and the FILTER function.

This is an awesome technique. Every time an item is chosen in the list, the list reduces and previously selected items are not shown.

In this example, we have a table of workers and a table of chores.

Table of workers and a table of chores

We will create a drop-down list of workers names to assign to the chores. Each time a name is assigned the list will reduce to show only the remaining names.

Watch the Shrinking Drop-Down List Video

Formula to Determine if a Name has been Used

This first task is to write a formula that can determine when a name has been used in the chores table.

For this, I will use the fabulous COUNTIF function in column F.

The formula below counts the occurrences of the names in the chores table and returns a 1 for Axel Foley, the only name currently assigned to a chore.

=COUNTIF(chores[This Week],workers[Workers])
Determine if a name has been used yet

Enter the formula in cell F2 causes it to spill to the other cells in column F for the table height.

New to dynamic array formulas? Check out this video of 8 things you need to know.

Set the Logical Test

With the used names determined, we need to set the logic so that the names with a 0 should be shown in the list still.

So we will convert names with a 0 to display True with the following formula.

=COUNTIF(chores[This Week],workers[Workers])=0
Logical test ready for the FILTER function

Filter the List for Shrinking Drop-Down List Effect

Now we will add the FILTER function to the formula to filter the list to show only the unused names.

This formula filters the workers table by the criteria we have already set.

=FILTER(workers[Workers],COUNTIF(chores[This Week],workers[Workers])=0)
Filter the list to only show unused names for the shrinking drop-down

Every time a name is used in the chores table, it is removed from column F.

Every time a name is added it is removed from the list

Sort the List

It may look like the list of names in column F is sorted, but it is just showing the names in the order that they appear in the workers table.

But what if the order of the names in the workers table was changed?

Let’s add the SORT function to the formula.

=SORT(FILTER(workers[Workers],COUNTIF(chores[This Week],workers[Workers])=0))

Now they will also appear in ascending order.

Create the Shrinking Drop-Down List

Now for the sexy part. Creating the shrinking drop-down list.

  1. Select the ‘This Week’ column of the chores table.
  2. Click Data > Data validation.
  3. Select the allow a List and enter the following formula in the Source box provided.
=$F$2#
Data Validation list reference for the shrinking drop-down list

The # is the spill reference for dynamic arrays.

The list only shows the names available to work.

Shrinking drop-down list in action

Hide Error Caused by no Names

If all of the names have been assigned to work, the drop-down shows the #CALC! error.

#CALC! error caused by no names in the list

Now you shouldn’t really have to worry about this, because nobody should be using the list if there are no names left.

But maybe you are using this technique in a scenario where it does matter. Or you just want to tidy this up.

The IFERROR function can be added to show an empty string instead.

=IFERROR(SORT(FILTER(workers[Workers],COUNTIF(chores[This Week],workers[Workers])=0)),"")
Blank list instead of error

Related Posts:

  • Sum formulas only in Excel
    Sum Formulas Only in Excel

Reader Interactions

Comments

  1. Kamran says

    16 June 2020 at 6:23 pm

    Dear I have office 2013 and I don’t have any ” FILTER” function it is about my office or what?

    Reply
    • Alan Murray says

      16 June 2020 at 6:44 pm

      Yes, FILTER is only available in the Microsoft 365 versions.

      Reply
  2. Sohail M Rizki says

    16 June 2020 at 7:19 pm

    This is amazing. Thank you, Filter, Sort and # all new for me.
    I have your course on Udemy and I’m learning a lot from this course, I highly recommend your courses on Udemy.
    Best regards,
    Sohail Rizki

    Reply
    • Alan Murray says

      16 June 2020 at 7:38 pm

      Thank you very much, Sohail.

      Reply
  3. Eric Reddy says

    23 September 2022 at 5:03 pm

    I’ve just used this tutorial to great effect. I’ve tried to use it for a list where the same name is used multiple times, but it does seem suitable. Are there other ways around my problem please?

    Reply

Trackbacks

  1. How to add a drop-down list in Excel - Excel Off The Grid says:
    3 July 2020 at 11:28 pm

    […] as the reference in the source box.  This method is excellent for advanced techniques, such as shrinking lists, or dependant […]

    Reply

Leave a Reply Cancel reply

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

Primary Sidebar

Recent Posts

  • Excel SWITCH Function – Nested IF Function Alternative
  • Sum Formulas Only in Excel
  • How to Calculate Age in Excel
  • Custom Sort in Excel
  • Case Sensitive Lookup with XLOOKUP in Excel
Advanced Excel Success book

Footer

Contact

[email protected]

LinkedIn Twitter YouTube

Useful Links

  • Home
  • Excel Online Courses
  • Tutorials
  • Sitemap
  • Privacy Policy
  • Jobs by Jooble

Course Topics

  • Blog
  • Charts
  • Courses
  • Dashboards
  • Downloads
  • Excel Tips
  • Formulas
  • Mail Merge
  • Office
  • PivotTables
  • Power BI
  • Power Pivot
  • Power Query
  • VBA

Join Our Mailing List

© Copyright 2009 Computergaga · All Rights Reserved ·