Get the list from a table headers drop down

nemmi69

Well-known Member
Joined
Mar 15, 2012
Messages
938
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
Platform
  1. Windows
Instead of reinventing the wheel is there a way to get the unique list that shows in a headers drop down?
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Do you mean the list in the filter selection box as shown?

If so then look at the UNIQUE function. The following when set as a formula in a cell will
give you a list of unique values in the given range.

=UNIQUE(DataTest!D2:D13,FALSE,FALSE)

Use the sort function to sort the list.

=SORT(UNIQUE(DataTest!D2:D13,FALSE,FALSE))

These will work in 365.
 

Attachments

  • filter.JPG
    filter.JPG
    66.2 KB · Views: 3
Upvote 0
Yes its the filtered list in the headers dropdown
 
Upvote 0
Although one might assume table headers would be unique, and they MUST be unique for an Excel Table, it's easy enough to get a unique list of any range using the UNIQUE function. When I use it, I typically using with SORT to get a sorted list of unique values as in SORT(UNIQUE(range)). In the case of an Excel Table's headers, the formula would be
Excel Formula:
=SORT(UNIQUE(TableName[#Headers]))
That said, if you need a list for a Data Validation list, that function will automatically produce a unique list of values of any range. Unfortunately there is (currently) no Sort option for that kind of Data Validation list. I have posted a request to add the option at the Excel Feedback site. If you think that's a good idea, please go here and give it a vote! Microsoft monitors the votes to determine features to be added, and right now it has only my vote ☹️!
 
Upvote 0
It is not the table headers that have to be unique it is the list that they contain in their dropdown.

I want to use them to build a report
 
Upvote 0
So where do you want to put this unique list of values in the cells below the header?
 
Upvote 0
In a variable to build a report against
 
Upvote 0
In a variable to build a report against
Formulas needed noted above. The results of the formulas will run down a column. If you need the results to run across a row, simply use TRANSPOSE to run the list across instead of down:
Excel Formula:
=TRANSPOSE(SORT(UNIQUE(TableName[#Headers])))
SORT is not needed if you need to maintain whatever order the source is.
 
Upvote 0
Doesnt that just return the headers?
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

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