'EXCEL unique values from multiple seperated columns into one column [duplicate]
Table 1 table 2 table 3
a a
e a
d g
t d
e c
e c
I want to have a results
Table 7
a
c
d
t
g
e
but theses two table is not next to each other... Thanks,
Solution 1:[1]
TEXTJOIN() and FILTERXML() can do it. Try-
=FILTERXML("<t><s>"&TEXTJOIN("</s><s>",TRUE,A2:C7)&"</s></t>","//s[not(preceding::*=.)]")
Solution 2:[2]
Using VTSACK() Function,
Formula used in cell E2
=UNIQUE(VSTACK(A2:A7,C2:C7))
Please note VSTACK() Function currently available in O365 Insiders Beta Channel Version, arrays can be non-contiguous irregular but needs to be vertical.
Also since you have non-contiguous ranges, TEXTJOIN() can also perform the same by wrapping it within FILTERXML() Function.
Formula used in cell F2
=UNIQUE(FILTERXML("<t><s>"&TEXTJOIN("</s><s>",,A2:A7,C2:C7)&"</s></t>","//s"))
Note: Since you have not mentioned your Excel Version, assumption made that you are using O365 - updated version.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Harun24hr |
| Solution 2 | Mayukh Bhattacharya |


