I'm looking for help setting up a formula that will allow me to have all distinct values for a lookup value in a vertical dataset, but I need the output to be in a horizontal output. The lookup range is a vertical set of emails, with the same email appearing multiple times, but potentially having the same or different results in the columns next to it. What I need is all distinct values related to that email from a column next to it, but returned in a single row.
I have found two array based formulas that accomplish to parts of this, but I can't seem to figure out a way to get it to do it together.
Distinct Values formula:
=IFERROR(INDEX('BL Department'!$G$2:$G$10000,MATCH(0,COUNTIF($M$4:M4,'BL Department'!$G$2:$G$10000)+('BL Department'!$A$2:$A$10000<>$A$5),0)),"")
or
IFERROR(INDEX(return_range, MATCH(0,COUNTIF(column_range, return_range)+(lookup_range<>lookup_value),0)),"")
This formula does what I want in that it returns only the distinct values, but it returns them in a column format.
Row All Results formula:
=IFERROR(INDEX('BL Department'!$G$2:$G$10000,SMALL(IF($A5='BL Department'!$A$2:$A$10000,ROW('BL Department'!$G$2:$G$10000)- MIN(ROW('BL Department'!$G$2:$G$10000))+1,""),COLUMN()-6)), "")
or
IFERROR(INDEX(return_range, SMALL(IF(lookup_value = lookup_range, ROW(lookup_range) - MIN(ROW( lookup_range))+1,""),COLUMN() - n)), "")
This formula returns the values in a row, but returns all of them.
Is there a way to modify the distinct values formula so that it returns on a row rather than a column?
I have found two array based formulas that accomplish to parts of this, but I can't seem to figure out a way to get it to do it together.
Distinct Values formula:
=IFERROR(INDEX('BL Department'!$G$2:$G$10000,MATCH(0,COUNTIF($M$4:M4,'BL Department'!$G$2:$G$10000)+('BL Department'!$A$2:$A$10000<>$A$5),0)),"")
or
IFERROR(INDEX(return_range, MATCH(0,COUNTIF(column_range, return_range)+(lookup_range<>lookup_value),0)),"")
This formula does what I want in that it returns only the distinct values, but it returns them in a column format.
Row All Results formula:
=IFERROR(INDEX('BL Department'!$G$2:$G$10000,SMALL(IF($A5='BL Department'!$A$2:$A$10000,ROW('BL Department'!$G$2:$G$10000)- MIN(ROW('BL Department'!$G$2:$G$10000))+1,""),COLUMN()-6)), "")
or
IFERROR(INDEX(return_range, SMALL(IF(lookup_value = lookup_range, ROW(lookup_range) - MIN(ROW( lookup_range))+1,""),COLUMN() - n)), "")
This formula returns the values in a row, but returns all of them.
Is there a way to modify the distinct values formula so that it returns on a row rather than a column?