SOLVED

Compare unsorted columns without interim calculation

%3CLINGO-SUB%20id%3D%22lingo-sub-3283195%22%20slang%3D%22en-US%22%3ECompare%20unsorted%20columns%20without%20interim%20calculation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3283195%22%20slang%3D%22en-US%22%3E%3CP%3EAs%20an%20elderly%20Excel%20tyro%2C%20I'm%20trying%20to%20see%20differences%20between%20two%20unsorted%20columns.%3CBR%20%2F%3EIn%20the%20particular%20case%20(see%20dummy%20example%20screenshot)%2C%20I%20have%20two%20aims%3A%3C%2FP%3E%3CP%3E1)%20In%20column%20G%2C%20I%20can%20show%20the%20L1%20items%20in%20col.%20B%20that%20are%20missing%20from%20L2%20items%20in%20col%20D.%3CBR%20%2F%3EBut%20I%20can't%20find%20a%20way%20to%20do%20this%20all%20in%20col%20F%2C%20without%20needing%20an%20intermediate%20col%20F%20in%20order%20to%20get%20the%20result%20in%20col%20G.%3CBR%20%2F%3EI'm%20sure%20this%20must%20be%20easy%2C%20but%20can't%20make%20it%20work%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Heapug_0-1649771696028.png%22%20style%3D%22width%3A%20637px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F363346i56A59EEEB27E1CCD%2Fimage-dimensions%2F637x375%3Fv%3Dv2%22%20width%3D%22637%22%20height%3D%22375%22%20role%3D%22button%22%20title%3D%22Heapug_0-1649771696028.png%22%20alt%3D%22Heapug_0-1649771696028.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E2)%20The%20next%20step%20would%20be%20to%20get%20the%20results%20to%20display%20in%20consecutive%20rows%20instead%20of%20spaced%20out%20as%20currently%20in%20col%20G.%20I%20know%20I%20can%20do%20this%20by%20filtering%20the%20results%20or%20pasting%20as%20data%20into%20a%20separate%20column%20and%20then%20sorting%20it%2C%20but%20I'd%20like%20to%20know%20how%20to%20do%20it%20straight%20into%20my%20desired%20column...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3283195%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3285044%22%20slang%3D%22en-US%22%3ERe%3A%20Compare%20unsorted%20columns%20without%20interim%20calculation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3285044%22%20slang%3D%22en-US%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1334524%22%20target%3D%22_blank%22%3E%40Heapug%3C%2FA%3E.%20Glad%20you%20have%20a%20solution%20%26amp%3B%20Thanks%20for%20providing%20feeback%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3285039%22%20slang%3D%22en-US%22%3ERe%3A%20Compare%20unsorted%20columns%20without%20interim%20calculation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3285039%22%20slang%3D%22en-US%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1174419%22%20target%3D%22_blank%22%3E%40Quadruple_Pawn%3C%2FA%3E%3A%20I%20fear%20my%20questions%20weren't%20really%20clearly%20enough%2C%20so%20I%20think%20you've%20provided%20a%20valid%20answer%20to%20a%20different%20problem%20from%20that%20which%20I%20was%20clumsily%20trying%20to%20frame.%3CBR%20%2F%3EBut%20I%20do%20appreciate%20the%20care%20and%20work%20that%20every%20answer%20represents%2C%20so%20many%20thanks%20for%20taking%20the%20trouble%20to%20answer.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3285031%22%20slang%3D%22en-US%22%3ERe%3A%20Compare%20unsorted%20columns%20without%20interim%20calculation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3285031%22%20slang%3D%22en-US%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F75890%22%20target%3D%22_blank%22%3E%40L%20z.%3C%2FA%3E%20%3A%20Apologies%20for%20not%20thanking%20you%20sooner%20for%20your%20answer.%20I%20probably%20didn't%20frame%20my%20questions%20clearly%2C%20so%20although%20it%20didn't%20seem%20to%20address%20my%20supplementary%20question%2C%20(as%20fixed%20by%20Patrick2788)%2C%20your%20answer%20is%20valuable%20to%20me%20as%20it%20shows%20how%20to%20neatly%20display%20both%20sides%20of%20the%20comparison%20between%20headings%20L1%20and%20L2.%20So%20I'll%20have%20to%20get%20familiar%20with%20XLOOKUP%20and%20XMATCH.%3CBR%20%2F%3EThanks%20for%20taking%20the%20time%20to%20help.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3285023%22%20slang%3D%22en-US%22%3ERe%3A%20Compare%20unsorted%20columns%20without%20interim%20calculation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3285023%22%20slang%3D%22en-US%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F428790%22%20target%3D%22_blank%22%3E%40Patrick2788%3C%2FA%3E%3A%20Apologies%20for%20not%20thanking%20you%20sooner%20--%20fixed%20both%20my%20requirements%20in%20one%20go.%20I%20can%20paste%20it%20into%20any%20old%20column%20and%20it%20works%20exactly%20as%20I%20wanted%20--%20although%20I%20haven't%20yet%20got%20my%20head%20around%20how%20it%20works%2C%20I'm%20sure%20I'll%20figure%20it%20out%2C%20given%20time.%3CBR%20%2F%3EMany%20thanks%20for%20amazingly%20quick%20and%20effective%20answer.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3283286%22%20slang%3D%22en-US%22%3ERe%3A%20Compare%20unsorted%20columns%20without%20interim%20calculation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3283286%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1334524%22%20target%3D%22_blank%22%3E%40Heapug%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20Excel%202021%20or%20365...%3C%2FP%3E%3CP%3Ein%20F3%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel-formula%22%3E%3CCODE%3E%3DXLOOKUP(D3%3AD15%2CB3%3AB15%2CB3%3AB15%2C%22%22)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3Ein%20G3%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel-formula%22%3E%3CCODE%3E%3DIF(ISNA(XMATCH(D3%3AD15%2CB3%3AB15))%2CD3%3AD15%2C%22%22)%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3283242%22%20slang%3D%22en-US%22%3ERe%3A%20Compare%20unsorted%20columns%20without%20interim%20calculation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3283242%22%20slang%3D%22en-US%22%3EIf%20working%20in%20365%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3DLET(b%2CB3%3AB15%2Cd%2CD3%3AD15%2CSORT(FILTER(d%2CISERROR(MATCH(d%2Cb%2C0)))%2C1%2C1))%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3283204%22%20slang%3D%22en-US%22%3ERe%3A%20Compare%20unsorted%20columns%20without%20interim%20calculation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3283204%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1334524%22%20target%3D%22_blank%22%3E%40Heapug%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3DIFERROR(VLOOKUP(D3%2CB%243%3AB%2415%2C1%2C0)%2CD3)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EIs%20this%20what%20you%20want%20to%20do%3F%20Enter%20the%20formula%20with%20ctrl%2Bshift%2Benter%20if%20you%20don't%20work%20with%20Office365%20or%202021.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

As an elderly Excel tyro, I'm trying to see differences between two unsorted columns.
In the particular case (see dummy example screenshot), I have two aims:

1) In column G, I can show the L1 items in col. B that are missing from L2 items in col D.
But I can't find a way to do this all in col F, without needing an intermediate col F in order to get the result in col G.
I'm sure this must be easy, but can't make it work

Heapug_0-1649771696028.png

2) The next step would be to get the results to display in consecutive rows instead of spaced out as currently in col G. I know I can do this by filtering the results or pasting as data into a separate column and then sorting it, but I'd like to know how to do it straight into my desired column...

 

7 Replies

@Heapug 

=IFERROR(VLOOKUP(D3,B$3:B$15,1,0),D3)

Is this what you want to do? Enter the formula with ctrl+shift+enter if you don't work with Office365 or 2021. 

best response confirmed by Heapug (Occasional Contributor)
Solution
If working in 365:

=LET(b,B3:B15,d,D3:D15,SORT(FILTER(d,ISERROR(MATCH(d,b,0))),1,1))

@Heapug 

 

If Excel 2021 or 365...

in F3:

=XLOOKUP(D3:D15,B3:B15,B3:B15,"")

in G3:

=IF(ISNA(XMATCH(D3:D15,B3:B15)),D3:D15,"")
@Patrick2788: Apologies for not thanking you sooner -- fixed both my requirements in one go. I can paste it into any old column and it works exactly as I wanted -- although I haven't yet got my head around how it works, I'm sure I'll figure it out, given time.
Many thanks for amazingly quick and effective answer.
@L z. : Apologies for not thanking you sooner for your answer. I probably didn't frame my questions clearly, so although it didn't seem to address my supplementary question, (as fixed by Patrick2788), your answer is valuable to me as it shows how to neatly display both sides of the comparison between headings L1 and L2. So I'll have to get familiar with XLOOKUP and XMATCH.
Thanks for taking the time to help.
@Quadruple_Pawn: I fear my questions weren't really clearly enough, so I think you've provided a valid answer to a different problem from that which I was clumsily trying to frame.
But I do appreciate the care and work that every answer represents, so many thanks for taking the trouble to answer.
@Heapug. Glad you have a solution & Thanks for providing feeback