=SORT(UNIQUE(FILTERXML("<t><s>"&TEXTJOIN("</s><s>",TRUE,A2:J6)&"</s></t>","//s")))
The above formula is for combining multi columns in one column.
I need to apply above formula for visible cells only. "d" is filtered in "A" column but still present in the results.
Please help me.
Thank you.


I found a workaround that may help you if the dataset isn't too large:
This solution requires a helper column.
If we put
=ROW()^10inK2and drag that down to the end of your range (or use=ROW(A2:J6)^10at once) then we created a helper column of values that if we sum combinations they will always sum up to unique values. We will use that in our solution.As we manually filter out any of the rows, the lines of the helper column would get filtered out as well. The function
SUBTOTALhas the built in function to work with unfiltered data only. In this case we use SUM and the argument for that is109. We can make use of that in our solution:before manual filter
after applying manual filter
Basically the formula checks if the sum for all possible combinations of the helper column equals the filtered subtotal of the helper column than apply a filter to the combination of these rows.
I know REDUCE or LAMBDA don't work in Office 2021, so I changed the FILTERXML to TOCOL in this formula.
While it will not work in Office 2021 I think you do have access to excel for the web and all this will work there. I hope that helps you in your situation.
EDIT Excel 2021 solution:
Alternate solution which I think uses solely functions compatible with Excel 2021: