0
votes

I have two sheets Sheet Main and Sheet Unique

On sheet Main, I have a range of data with headers

On sheet Unique in cell A1 I have a drop-down of all the header names from sheet Main

In cell B1 of sheet Unique, I have the formula

=SUBSTITUTE(ADDRESS(A1,MATCH(A1,Main !A1:AA1,0),4),1,"")

Which gets the Column letter of the header on sheet Main from the dropdown on sheet Unique

Is cell A2 on sheet Unique I have the formula

=SORT(UNIQUE(TRANSPOSE(ARRAYFORMULA(TRIM(SPLIT(JOIN("|",Main!F2:F),"|"))))))

Which gets the unique list of elements from the column on sheet Main that was selected from the drop-down on sheet Unique.

In this case, F2:F is the range on sheet Main of the selected header from sheet Unique

I want to update the formula

=SORT(UNIQUE(TRANSPOSE(ARRAYFORMULA(TRIM(SPLIT(JOIN("|",Main!F2:F),"|"))))))

automatically every time I make a new selection from the Drop-down on the sheet Unique

Combing the two formulas I get and adding INDIRECT

=SORT(UNIQUE(TRANSPOSE(ARRAYFORMULA(TRIM(SPLIT(JOIN("|",Main!&INDIRECT(SUBSTITUTE(ADDRESS(Y1,MATCH(A1,Main!$A$1:$AA$1,0),4),1,""),"|"))))))))

I get the error formula parse error I can not get what I am doing wrong!

Thanks for any assistance

1
share a copy/sample of your sheetplayer0

1 Answers

2
votes

Try this in cell Unique!A2:

=unique(sort(indirect("Main!"&substitute(address(1,match(A1,Main!1:1,0),4),"1","")&"2:"&substitute(address(1,match(A1,Main!1:1,0),4),"1","")),1,1))