Search code examples
excelvbams-office

Alternative of FILTER function on non office 365


Using a Macro or Formula, is there a way to achieve the result of the following formula of Office 365?

=FILTER(B:B,A:A = "x")

What it does is get all the values from Column B if Column A on the same row has a value of x.

My PC has office 365 but the one I'm working with only has Office Pro Plus 2019. I had to use my pc when I needed the function and I'm getting tired of it, maybe it can be done on Office Pro Plus 2019 too using a formula or a macro?


Solution

  • Use:

    =IFERROR(INDEX($B$1:$B$100,AGGREGATE(15,7,ROW($A$1:$A$100)/($A$1:$A$100="x"),ROW($ZZ1))),"")
    

    Note the use of a set range and not full columns. That is done on purpose, This being an array formula it will do a lot of calculations each cell it is placed. Limiting the range to the data set will speed it up.

    Put this in the first cell of the output and copy down till blanks are returned.