Unique Formula for visible cells only

Chewyhairball

Board Regular
Joined
Nov 30, 2017
Messages
205
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi

I am using the unique formula to extract a list of unique values from a table and I have to say I am a big fan of this formula having just discovered it.

=UNIQUE(Table5[[#Data],[Building]])

Is there a way to use this formula ( or similar) to extract a unique list from visible rows only?

When I have other filters applied it would be good to be able to extract only the visible rows to create the unique list. I use this column to create a drop down list so I guess what my goal is is to
create a dynamic dropdown list.

I am not looking for VBA for this rather trying to find out if there is a way to do it with a formula.

thanks

Rory

Rory
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

jasonb75

Well-known Member
Joined
Dec 30, 2008
Messages
14,611
Office Version
  1. 365
Platform
  1. Windows
I would say use a helper column with a subtotal formula for the row, for example
Excel Formula:
=SUBTOTAL(2,[@Data])
Then change the unique formula to
Excel Formula:
=UNIQUE(FILTER(Table5[[#Data],[Building]],Table5[Helper]=1,""))
Think that is right, but without setting up a table to test the syntax, there could be any number of errors :oops:
 
Solution

Chewyhairball

Board Regular
Joined
Nov 30, 2017
Messages
205
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Thanks jason. Ill give it a bash and let you know how i get on :)
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
68,027
Office Version
  1. 365
Platform
  1. Windows
Whilst I'd go with the helper column that Jason has suggested, another option would be
Excel Formula:
=UNIQUE(FILTER(Table5[Building],SUBTOTAL(3,OFFSET(Table5[[#Headers],[Building]],ROW(Table5[Building])-ROW(Table5[[#Headers],[Building]]),0))))
although this is volatile, which could have an adverse affect on the performance of your workbook.
 

Chewyhairball

Board Regular
Joined
Nov 30, 2017
Messages
205
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi, I went with the helper table and it is perfect for what i need. Thank you both for the replies :)
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
68,027
Office Version
  1. 365
Platform
  1. Windows
Glad we could help & thanks for the feedback.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,151,972
Messages
5,767,397
Members
425,410
Latest member
SmittyT

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
Top