Extracting items not on both lists

tigerzen

Board Regular
Joined
Mar 8, 2023
Messages
165
Office Version
  1. 365
Platform
  1. Windows
Looking for a formula to pull out the records shaded in red.
Football stats functions.xlsx
ABCDE
1Group 1Group 2
2JackKenPeterVic
3TomSallyTomFred
4PeterVicJaneMilton
5JaneSally
Sheet17
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:E5Cell Valueunique valuestextNO
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
One way:

23 09 09.xlsm
ABCDEFG
1Group 1Group 2List
2JackKenPeterVicJack
3TomSallyTomFredKen
4PeterVicJaneMiltonFred
5JaneSallyMilton
6
Sheet5
Cell Formulas
RangeFormula
G2:G5G2=UNIQUE(VSTACK(TOCOL(A2:B5,1),TOCOL(D2:E5,1)),,1)
Dynamic array formulas.


Or IF there is no data between the two lists and a name will not appear more than once in a list ..

23 09 09.xlsm
ABCDEFG
1Group 1Group 2List
2JackKenPeterVicJack
3TomSallyTomFredKen
4PeterVicJaneMiltonFred
5JaneSallyMilton
6
Sheet6
Cell Formulas
RangeFormula
G2:G5G2=UNIQUE(TOCOL(A2:E5,1),,1)
Dynamic array formulas.
 
Upvote 0
Try this formula:

=COUNTIF($A$2:$E$5,A2)=1
Hi Phuoc, thanks for that response, I'd actually started with something similar myself. Your formula does return the correct values as TRUE/FALSE but I can't get it to convert them into actual names such as Fred etc. I've been unsuccessful so far in finding out how to do this. I've tried using IF, SUMPRODUCT but nothing has worked for me yet, would like to know how to resolve this.
 
Upvote 0
One way:

23 09 09.xlsm
ABCDEFG
1Group 1Group 2List
2JackKenPeterVicJack
3TomSallyTomFredKen
4PeterVicJaneMiltonFred
5JaneSallyMilton
6
Sheet5
Cell Formulas
RangeFormula
G2:G5G2=UNIQUE(VSTACK(TOCOL(A2:B5,1),TOCOL(D2:E5,1)),,1)
Dynamic array formulas.


Or IF there is no data between the two lists and a name will not appear more than once in a list ..

23 09 09.xlsm
ABCDEFG
1Group 1Group 2List
2JackKenPeterVicJack
3TomSallyTomFredKen
4PeterVicJaneMiltonFred
5JaneSallyMilton
6
Sheet6
Cell Formulas
RangeFormula
G2:G5G2=UNIQUE(TOCOL(A2:E5,1),,1)
Dynamic array formulas.
Thanks Peter, very clever and appreciate the solution variation in the event that the datasets are contiguous.
 
Upvote 0
Late to the game, but thought I would show you an alternative with Power Query which may be effective if you have some very large tables.

Book2
ABCDEFG
1Group 1Group 2
2Column1Column2Column1Column2Missing
3JackKenPeterVicFred
4TomSallyTomFredMilton
5PeterVicJaneMiltonJack
6JaneSallyKen
Sheet1


Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(Source, {}, "Attribute", "Value"),
    #"Removed Columns" = Table.RemoveColumns(#"Unpivoted Columns",{"Attribute"}),
    Source2=Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
    #"Unpivoted Columns1" = Table.UnpivotOtherColumns(Source2, {}, "Attribute", "Value"),
    #"Removed Columns1" = Table.RemoveColumns(#"Unpivoted Columns1",{"Attribute"}),
    MQ = Table.NestedJoin(#"Removed Columns", {"Value"},  #"Removed Columns1", {"Value"}, "TableX", JoinKind.LeftAnti),
    #"Expanded TableX" = Table.ExpandTableColumn(MQ, "TableX", {"Value"}, {"Value.1"}),
    #"Removed Columns2" = Table.RemoveColumns(#"Expanded TableX",{"Value.1"}),
    MQ2 = Table.NestedJoin(#"Removed Columns", {"Value"},  #"Removed Columns1", {"Value"}, "TableY", JoinKind.RightAnti),
    #"Expanded TableY" = Table.ExpandTableColumn(MQ2, "TableY", {"Value"}, {"Value.1"}),
    #"Removed Columns3" = Table.RemoveColumns(#"Expanded TableY",{"Value"}),
    MQ3 = Table.NestedJoin(#"Removed Columns2", {"Value"},  #"Removed Columns3", {"Value.1"}, "TableY", JoinKind.FullOuter),
    #"Expanded TableY1" = Table.ExpandTableColumn(MQ3, "TableY", {"Value.1"}, {"Value.1"}),
    #"Added Custom" = Table.AddColumn(#"Expanded TableY1", "Missing", each if [Value.1]= null then [Value] else [Value.1]),
    #"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Missing"})
in
    #"Removed Other Columns"
 
Upvote 0
Late to the game, but thought I would show you an alternative with Power Query which may be effective if you have some very large tables.

Book2
ABCDEFG
1Group 1Group 2
2Column1Column2Column1Column2Missing
3JackKenPeterVicFred
4TomSallyTomFredMilton
5PeterVicJaneMiltonJack
6JaneSallyKen
Sheet1


Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(Source, {}, "Attribute", "Value"),
    #"Removed Columns" = Table.RemoveColumns(#"Unpivoted Columns",{"Attribute"}),
    Source2=Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
    #"Unpivoted Columns1" = Table.UnpivotOtherColumns(Source2, {}, "Attribute", "Value"),
    #"Removed Columns1" = Table.RemoveColumns(#"Unpivoted Columns1",{"Attribute"}),
    MQ = Table.NestedJoin(#"Removed Columns", {"Value"},  #"Removed Columns1", {"Value"}, "TableX", JoinKind.LeftAnti),
    #"Expanded TableX" = Table.ExpandTableColumn(MQ, "TableX", {"Value"}, {"Value.1"}),
    #"Removed Columns2" = Table.RemoveColumns(#"Expanded TableX",{"Value.1"}),
    MQ2 = Table.NestedJoin(#"Removed Columns", {"Value"},  #"Removed Columns1", {"Value"}, "TableY", JoinKind.RightAnti),
    #"Expanded TableY" = Table.ExpandTableColumn(MQ2, "TableY", {"Value"}, {"Value.1"}),
    #"Removed Columns3" = Table.RemoveColumns(#"Expanded TableY",{"Value"}),
    MQ3 = Table.NestedJoin(#"Removed Columns2", {"Value"},  #"Removed Columns3", {"Value.1"}, "TableY", JoinKind.FullOuter),
    #"Expanded TableY1" = Table.ExpandTableColumn(MQ3, "TableY", {"Value.1"}, {"Value.1"}),
    #"Added Custom" = Table.AddColumn(#"Expanded TableY1", "Missing", each if [Value.1]= null then [Value] else [Value.1]),
    #"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Missing"})
in
    #"Removed Other Columns"
Thanks Alan, appreciate this as I do have some files with large tables.
 
Upvote 0

Forum statistics

Threads
1,215,409
Messages
6,124,733
Members
449,185
Latest member
hopkinsr

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