Question

I have a excel problem which has been racking my brain.

I have a list of 1740 student names on a master list (ML) and 956 student's names (PT) who took their yearbook photos. I need to compare the two to form a new list (NL) that I can export into a text file to import into a InDesign file for a no-picture list.

Also, the names in J and K are not side by side but might be shifted in some areas. They are also in different cases one is upper and the other is proper. They are also full names [First Last].

I've tried working with if and countif functions with no avail.

I want to do this:

       (ML)    (PT)    (NL)
       J       K       M
1      Alex    James   Alex
2      James   Alex    John
3      John    Jason   Jamie
4      Lexie   Lexie   
5      Jamie   Austin
6      Austin
7      Alex

I need at least a solution that can give me a new list that can be alphabetized eventually by their surname if it requires more steps however if it can be achieved in a single function that would be great.

Was it helpful?

Solution

A single formula that addresses the end requirement might be possible, but it would be a nasty formula indeed. A couple simple formulae and short workflow might suffice:

In a blank column e.g. M2 write formula

=VLOOKUP(J2,K:K,1,FALSE)

and fill down as far as values go in column J. The result will be #N/A wherever there is no match--these are the people with no picture. VLOOKUP will ignore case differences, and the formula doesn't care if the matching name is on a different row.

Since you want to order by surname you will need a way to get that information out of the [First Last] format. In another blank column, write formula

=MID(J2,FIND(" ",J2,1)+1,30)

and again fill down.

The whole thing can now be sorted on two keys: primary on the VLOOKUP column, and secondary on the surname column. The #N/A people will sort to the bottom of the list, making the full names easy to copy off for further processing.


Edit: In pictures:

Step 1: I added surnames because that's the real use case. Note there are two different people named "Alex". Now add the formulae I gave above (shown in red here):

enter image description here

Step 2: Sort the range as described above.

enter image description here

Step 3: The people shaded in green are not in the PT column. We know this because the lookup column returned #N/A. Also, their names are sorted by surname.

enter image description here

Hope this helps to clarify.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top