Filter function with dropdown List

olund

New Member
Joined
Oct 17, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi folks.

I'm pretty new with excel and not so familiar with the coding yet so I am trying to make an way to filter some data from my dropdown list. Due to the amount of data I have them on multiple different sheets but I want to be able to collect the correct information with the dropdown list. To do that I figured that I could filter with the dropdown list as a target. So the way I did it was to use the dropdown list to grab the name of the sheet as well but it wont read it. So I basically hoped this would work: =FILTER(CONCAT(Data!A4,"Data",Data!B4)!A:T,CONCAT(Data!A4,"Data",Data!B4)!R:R=A4,0) where DataA4 reads the first part of the sheet name from the dropdown list while DataB4 reads the last part so when merged it shows brandDataMarket!A:T. Excel seems to not want to read it when I have grabbed the text from somewhere to use it for the filter. Anyone know the reason for this or have another way of doing it?

Thanks
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

jasonb75

Well-known Member
Joined
Dec 30, 2008
Messages
14,621
Office Version
  1. 365
Platform
  1. Windows
where DataA4 reads the first part of the sheet name from the dropdown list while DataB4 reads the last part so when merged it shows brandDataMarket!A:T
When you want to create a range reference from text or cell content you need to use the INDIRECT function to convert it to a proper range reference.
Excel Formula:
=FILTER(INDIRECT("'"&Data!A4&"Data"&Data!B4&"'!A:T"),INDIRECT("'"&Data!A4&"Data"&Data!B4&"'!R:R")=A4,0)
This is likely to be slow to process with entire columns. Also, being a volatile function, it will calculate more often than other formulas which could make your workbook unuseable.

Edited formula, noticed missing apostrophe.
 
Last edited:

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
68,101
Office Version
  1. 365
Platform
  1. Windows
Hi & welcome to MrExcel.
You need to use the indirect function, like
Excel Formula:
=FILTER(INDIRECT("'"&Data!A4&"Data"&Data!B4&"'!A:T&"),INDIRECT("'"&Data!A4&"Data"&Data!B4&"'!R:R")=A4,0)
 

olund

New Member
Joined
Oct 17, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Thanks for the help. Worked like a charm :)
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
68,101
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,152,126
Messages
5,768,264
Members
425,460
Latest member
Astros1243

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