UDF as an alternative for the new FILTER function built-in for the Excel 365

omairhe

Well-known Member
Joined
Mar 26, 2009
Messages
2,040
Office Version
  1. 2019
Platform
  1. Windows
Hey Excel Gurus,

How are you guys doing today? I need a big favor from you. I am using older version of Ms Excel and in it the newer FILTER function that works by default in Office 365 is missing. I was hoping if anyone can make a UDF that could work exactly same way as the original.

Thanks a lot and will appreciate..
 
Looks like you are just dealing with a column of values so would this also work for you?
I've just done it on one sheet but you should be able to adapt to two if it meets your need.

VBA Code:
Function Fltr(col As Range, FilterFor As String)
  Fltr = Filter(Application.Transpose(col), FilterFor, True, vbTextCompare)
End Function

omairhe 2020-02-24 1.xlsm
ABCDE
1SubstituesubSubstitue
2IntersubIntersub
3manlysubstance
4substance 
5 
Sheet2
Cell Formulas
RangeFormula
E1:E5E1=IFERROR(INDEX(Fltr(A$1:A$4,C$1),ROWS(E$1:E1)),"")

Thank you, it fulfills my requirement..
 
Upvote 0

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
You're welcome.

BTW, you could also use standard worksheet functions to do the job without needing vba. :)

Depending on your Excel version [I suggest that you update your Account details (click your user name at the top right of the forum) so helpers know what Excel version(s) & platform(s) you are using as the best solution often varies by version] you could use something like this.

omairhe 2020-02-24 1.xlsm
ABCDE
1SubstituesubSubstitue
2IntersubIntersub
3manlysubstance
4substance 
5 
Sheet3
Cell Formulas
RangeFormula
E1:E5E1=IFERROR(INDEX(A:A,AGGREGATE(15,6,ROW(A$1:A$4)/ISNUMBER(SEARCH(C$1,A$1:A$4)),ROWS(E$1:E1))),"")
 
Upvote 0

Forum statistics

Threads
1,215,731
Messages
6,126,532
Members
449,316
Latest member
sravya

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