Finding data not on a list

%3CLINGO-SUB%20id%3D%22lingo-sub-2390987%22%20slang%3D%22en-US%22%3EFinding%20data%20not%20on%20a%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2390987%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20guys%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20using%20Windows%2010%20and%20Office%20365.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20looking%20to%20try%20and%20find%20all%20the%20date%20that%20is%20not%20on%20a%20different%20list.%20I%20have%202%20lists%20of%20names%2C%201%20which%20is%20split%20into%20First%20and%20Surname%20(say%20column%20A%20and%20B)%20with%20around%201500%20rows%20and%20another%20with%20first%20and%20surname%20in%20one%20column%20(say%20c)%20but%20over%203000%20rows.%20Is%20there%20any%20way%20for%20me%20to%20compare%20the%202%20lists%20to%20find%20the%20names%20which%20are%20MISSING%2C%20I%20can%20find%20the%20names%20which%20are%20on%20both%20but%20unable%20to%20find%20the%20names%20which%20are%20in%20the%203000%20and%20not%20in%20the%201500.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20any%20help%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2390987%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ETraining%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2391060%22%20slang%3D%22en-US%22%3ERe%3A%20Finding%20data%20not%20on%20a%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2391060%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1063823%22%20target%3D%22_blank%22%3E%40ExcelLearner2395%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20begin%20with%20%22%3CSPAN%3E%3CEM%3EI'm%20looking%20to%20try%20and%20find%20all%20the%20%3CU%3Edate%3C%2FU%3E%3C%2FEM%3E%22%20then%20you%20talk%20about%20names%20-%20a%20bit%20confusing%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Aslightly_smiling_face%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Demo.png%22%20style%3D%22width%3A%20373px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F284267i4E421456400C43FD%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Demo.png%22%20alt%3D%22Demo.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20assumed%20the%20First%20%2B%20Surnames%20in%20your%20column%20C%20are%20delimited%20with%20a%20%3CSPACE%3E%20otherwise%20adapt%3C%2FSPACE%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3Ein%26nbsp%3B%3CSTRONG%3ED2%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DFILTER(C2%3AC6%2C%20ISNA(MATCH(C2%3AC6%2C(A2%3AA4%20%26amp%3B%20%22%20%22%20%26amp%3B%20B2%3AB4)%2C0))%20)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2391093%22%20slang%3D%22en-US%22%3ERe%3A%20Finding%20data%20not%20on%20a%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2391093%22%20slang%3D%22en-US%22%3EMany%20thanks%20for%20this%2C%20sorry%20my%20wording%20was%20poor%20in%20the%20inital%20I%20meant%20to%20type%20%22I%3Bm%20looking%20to%20tra%20and%20find%20all%20the%20data%22%20even%20though%20I%20meant%20names%20still.%20This%20is%20basically%20what%20I%20am%20looking%20for%20except%20I%20would%20need%20the%20results%20to%20be%20back%20into%202%20columns%20-%20First%20and%20Last%20names%20seperately.%20Do%20you%20know%20if%20there%20is%20a%20way%20for%20me%20to%20do%20this%3F%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%20again%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2391270%22%20slang%3D%22en-US%22%3ERe%3A%20Finding%20data%20not%20on%20a%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2391270%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1063823%22%20target%3D%22_blank%22%3E%40ExcelLearner2395%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20don't%20see%20a%20way%20to%20dynamically%20split%20(via%20formula)%20the%20content%20of%20a%20cell%20(i.e.%20D1)%20in%202%20columns.%20So%20the%20suggestion%20remains%20the%20same%20(you%20can%20hide%20column%20D)%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Demo.png%22%20style%3D%22width%3A%20521px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F284273iB4A3742E24FB3A67%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Demo.png%22%20alt%3D%22Demo.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CBR%20%2F%3Ein%20%3CSTRONG%3EE2%3C%2FSTRONG%3E%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DLEFT(D2%23%2C%20SEARCH(%22%20%22%2CD2%23)-1)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3Ein%20%3CSTRONG%3EF2%3C%2FSTRONG%3E%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DMID(D2%23%2C%20LEN(E2%23)%2B1%2C%20255)%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2391345%22%20slang%3D%22en-US%22%3ERe%3A%20Finding%20data%20not%20on%20a%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2391345%22%20slang%3D%22en-US%22%3Ealternatively%20just%20reverse%20the%20ranges%20in%20the%20first%20formula%20from%20%3A%3CBR%20%2F%3E%3DFILTER(A2%3AB4%2CISNA(MATCH(A2%3AA4%26amp%3B%22%20%22%26amp%3BB2%3AB4%2C%24C%242%3A%24C%246%2C0)))%3CBR%20%2F%3Eif%20the%20names%20are%20hand%20typed%20you%20might%20also%20want%20to%20filter%20excess%20spaces%3A%3CBR%20%2F%3E%3DFILTER(A2%3AB4%2CISNA(MATCH(TRIM(A2%3AA4)%26amp%3B%22%20%22%26amp%3BTRIM(B2%3AB4)%2C%24C%242%3A%24C%246%2C0)))%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2391436%22%20slang%3D%22en-US%22%3ERe%3A%20Finding%20data%20not%20on%20a%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2391436%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1063823%22%20target%3D%22_blank%22%3E%40ExcelLearner2395%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20variant%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20356px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F284287i5602904836F34338%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3Ewith%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DLET(%0A%20%20range%2C%20%20%20%20%20%20A2%3AC10%2C%0A%20%20first%2C%20%20%20%20%20%20INDEX(range%2C0%2C1)%2C%0A%20%20last%2C%20%20%20%20%20%20%20INDEX(range%2C0%2C2)%2C%0A%20%20both%2C%20%20%20%20%20%20%20INDEX(range%2C0%2C3)%2C%0A%20%20included%2C%20%20%20COUNTIFS(both%2C%20first%20%26amp%3B%20%22%20%22%20%26amp%3B%20last)%2C%0A%20%20bothMissed%2C%20FILTER(both%2C%20NOT(included)*(both%26lt%3B%26gt%3B%22%22))%2C%0A%20%20seps%2C%20%20%20%20%20%20%20FIND(%22%20%22%2CbothMissed)%2C%0A%20%20firstMissed%2CLEFT(bothMissed%2Cseps)%2C%0A%20%20lastMissed%2C%20RIGHT(bothMissed%2CLEN(bothMissed)-seps)%2C%0A%20%20IF(%7B1%2C0%7D%2C%20firstMissed%2C%20lastMissed)%0A)%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi guys,

 

I'm using Windows 10 and Office 365.

 

I'm looking to try and find all the date that is not on a different list. I have 2 lists of names, 1 which is split into First and Surname (say column A and B) with around 1500 rows and another with first and surname in one column (say c) but over 3000 rows. Is there any way for me to compare the 2 lists to find the names which are MISSING, I can find the names which are on both but unable to find the names which are in the 3000 and not in the 1500.

 

Thanks for any help

12 Replies

@ExcelLearner2395 

You begin with "I'm looking to try and find all the date" then you talk about names - a bit confusing

Demo.png

I assumed the First + Surnames in your column C are delimited with a <space> otherwise adapt

in D2

=FILTER(C2:C6, ISNA(MATCH(C2:C6,(A2:A4 & " " & B2:B4),0)) )

 

 

Many thanks for this, sorry my wording was poor in the inital I meant to type "I;m looking to tra and find all the data" even though I meant names still. This is basically what I am looking for except I would need the results to be back into 2 columns - First and Last names seperately. Do you know if there is a way for me to do this?

Thanks again

@ExcelLearner2395 

I don't see a way to dynamically split (via formula) the content of a cell (i.e. D1) in 2 columns. So the suggestion remains the same (you can hide column D)

Demo.png


in E2

=LEFT(D2#, SEARCH(" ",D2#)-1)

in F2

=MID(D2#, LEN(E2#)+1, 255)
alternatively just reverse the ranges in the first formula from :
=FILTER(A2:B4,ISNA(MATCH(A2:A4&" "&B2:B4,$C$2:$C$6,0)))
if the names are hand typed you might also want to filter excess spaces:
=FILTER(A2:B4,ISNA(MATCH(TRIM(A2:A4)&" "&TRIM(B2:B4),$C$2:$C$6,0)))

@ExcelLearner2395 

As variant

image.png

with

=LET(
  range,      A2:C10,
  first,      INDEX(range,0,1),
  last,       INDEX(range,0,2),
  both,       INDEX(range,0,3),
  included,   COUNTIFS(both, first & " " & last),
  bothMissed, FILTER(both, NOT(included)*(both<>"")),
  seps,       FIND(" ",bothMissed),
  firstMissed,LEFT(bothMissed,seps),
  lastMissed, RIGHT(bothMissed,LEN(bothMissed)-seps),
  IF({1,0}, firstMissed, lastMissed)
)

@ExcelLearner2395 

MATCH (or these days XMATCH provides a good way of locating missing names

= LET(
  missing, ISNA(XMATCH(Name, First&" "&Last)),
  FILTER(Name, missing) )

(only the presentation is different).

 

To do the same thing with COUNTIFS requires greater effort.  One way round the formula could be

= LET(
  space, SEARCH(" ", Name),
  fName, LEFT(Name, space-1),
  sName, MID(Name, space+1,10),
  found, COUNTIFS(First, fName, Last, sName),
  FILTER(Name, NOT(found)))

and the reverse

= LET(
  matches,  COUNTIFS(Name, First&"*", Name, "*"&Last),
  FILTER((First&" "&Last),  NOT(matches)))

Just for fun, I generated the list of names that appeared in either list but not both by defining a Lambda function VSTACKλ to equal

= LAMBDA(A₁,A₂,
   LET(
    m₁, ROWS(A₁),
    m₂, ROWS(A₂),
    k, SEQUENCE(m₁+m₂),
    IF(k<=m₁, INDEX(A₁, k), INDEX(A₂, k-m₁)))
   )

so the formula on the worksheet is given by

= LET(
  combined, VSTACKλ(First&" "&Last, Name),
  UNIQUE( combined, , 1) )

 

 

I have just seen the requirement to split the names

 = LET(
   space, SEARCH(" ", Name),
   fName, LEFT(Name, space-1),
   sName, MID(Name, space+1,10),
   found, COUNTIFS(First, fName, Last, sName),
   table, IF({1,0}, fName, sName),
   FILTER(table, NOT(found)))

@Peter Bartholomew  I liked your idea of finding the results bi-directional (especially since my first answer above completely missed the intended direction) so I did a version without Lambda:

=LET(m,$A$2:$B$50,n,$C$2:$C$50,
     s,ROWS(m),t,SEQUENCE(s+ROWS(n)),
     u,UNIQUE(IF(t<=s,INDEX(m,t,1)&" "&INDEX(m,t,2),INDEX(n,t-s)),0,1),
     CHOOSE({1,2},
          LEFT(SUBSTITUTE(u," ",REPT(" ",LEN(u))),LEN(u)),
          RIGHT(SUBSTITUTE(u," ",REPT(" ",LEN(u))),LEN(u))))

@mtarler 

I get the impression that the LAMBDA function was only introduced as early as it was in the transformation of Excel because it leveraged the work already done for LET. The main difference is the reusability of the LAMBDA.

I accept it is a bit premature to introduce it into Q&As though. I have an alternative of using Charles Williams's FastExcel which has VSTACK and HSTACK functions but that makes the solution even more inaccessible. Mind you, Charles has now written a runtime version which I should investigate.

@Peter Bartholomew 

The only point is to make a guess what is the Name, First etc here. In particular same size ranges or not, do you think that's obvious for everyone?

@Peter Bartholomew 

Oh, why do we need lambdas here? 

@Sergei Baklan 

As an answer for the OP, we don't.
For my own use, I would employ the FastExcel function VSTACK, and that was my starting point.
I based the names on @L z. picture, though I had moved the range so my cell references would not be the same even if I quoted them.