Excel formula to extract unique values between two columns?

MEUserII

Board Regular
Joined
Oct 27, 2017
Messages
91
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
Platform
  1. Windows
Consider the following data set:
R/C
A
B
C
D
1
A​
B​
A​
2
C​
C​
B​
3
C​
D​
C​
4
D​
D​
D​
5
D​
E​
E​
6
F​
G​
F​
7
G​
G​
G​
8
G​
G​
H​
9
G​
G​
10
H​
H​
11
H​
H​
12
H​
H​
13
H​
H​
Is there a way via an Excel formula to extract all unique values between two columns: column A and column B? Specifically, I have listed the desired result in column D.
For context, I am trying to come up with a formula that does this without using the new UNIQUE() function.

As a reference, there is an example formula linked below that provides a formula for how to extract unique values for only one column.
Link: Excel formula: Extract unique items from a list | Exceljet
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
why do you want a formula to pull out "Unique" values without using the "unique" formula? 🤷‍♂️
 
Upvote 0
why do you want a formula to pull out "Unique" values without using the "unique" formula? 🤷‍♂️
Thanks for the reply; I need this formula to be backwards compatible with some older versions of Excel that predate the addition of the UNIQUE() function. Any formula suggestions would be appreciated, thanks!
 
Upvote 0
Not relevant to this question but in any case I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

I need this formula to be backwards compatible with some older versions
Try this

22 09 04.xlsm
ABCD
1
2ABA
3CCB
4CDC
5DDD
6DEE
7FGF
8GGG
9GGH
10GG 
11HH 
12HH 
13HH 
Unique
Cell Formulas
RangeFormula
D2:D13D2=IFERROR(INDIRECT(TEXT(AGGREGATE(15,6,(ROW(A$2:B$13)*10^6+COLUMN(A$2:B$13))/((A$2:B$13<>"")*(ISNA(MATCH(A$2:B$13,D$1:D1,0)))),1),"R000000C000000"),0),"")
 
Upvote 0
Solution
Not relevant to this question but in any case I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
Thanks @Peter_SSs for the tip! I've updated my account details with Excel version(s) & platforms I'm using.

Try this

22 09 04.xlsm
ABCD
1
2ABA
3CCB
4CDC
5DDD
6DEE
7FGF
8GGG
9GGH
10GG 
11HH 
12HH 
13HH 
Unique
Cell Formulas
RangeFormula
D2:D13D2=IFERROR(INDIRECT(TEXT(AGGREGATE(15,6,(ROW(A$2:B$13)*10^6+COLUMN(A$2:B$13))/((A$2:B$13<>"")*(ISNA(MATCH(A$2:B$13,D$1:D1,0)))),1),"R000000C000000"),0),"")
Ah, this is an really clever solution @Peter_SSs. I'm going through the formula's calculation step by step to understand how to it works; specifically, this formula returns the desired result in $D$2 (seemingly in alphabetical order no less). :)
I've marked your post as the solution to this Excel problem; though I will likely follow up with a specific question on how this formula works.
For reference, I have a formula textbook, Control+Shift+Enter Mastering Excel Array Formulas by Mike "excelisfun" Girvin, and I was surprised a formula for this Excel problem wasn't in there.
 
Upvote 0
(seemingly in alphabetical order no less)
That is only because the sample data was in alphabetical order. ;)

22 09 04.xlsm
ABCD
1
2JXJ
3KCX
4CDK
5DDC
6DED
7FGE
8GAF
9GGG
10GGA
11HHH
12HH 
13HH 
Unique (3)
Cell Formulas
RangeFormula
D2:D13D2=IFERROR(INDIRECT(TEXT(AGGREGATE(15,6,(ROW(A$2:B$13)*10^6+COLUMN(A$2:B$13))/((A$2:B$13<>"")*(ISNA(MATCH(A$2:B$13,D$1:D1,0)))),1),"R000000C000000"),0),"")
 
Upvote 0

Forum statistics

Threads
1,223,262
Messages
6,171,080
Members
452,377
Latest member
bradfordsam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top