Merging data from two excel spreadsheets - excel

I have two Excel spreadsheets.
One has a list of Student Names and Student Numbers (Columns A,B,C)
Johnson, Joe, 1001
Campbell, Pete, 1002
Reed, Eric, 5004
The other file has just the names (Columns A,B):
Reed, Eric
Johnson, Joe
Campbell, Pete
Column A = last Name, Column B = First Name, Column C = Student Number (in file A)
I need to insert the corresponding student numbers into file b, so that it looks the same as file A.
The reason I can't copy/paste is because file a contains a whole bunch of names that are not in file b, and neither are in the correct order.

See example below of a two-column lookup using INDEX and MATCH. Simplified a little since both sets of data are on the same sheet...
Don't forget to use Ctrl+Shift+Enter when entering it, since it's an array-type formula.

Related

Finding the values that don't match from one sheet inside a few cells of another sheet

I have an excel document with two sheets sheet1 and sheet2. Sheet1:
ID number Name
123 John
321 Pete
Sheet2:
Book Comment Comment2 Comment3
Harry Potter My ID number is 123
TLOTR The book is ripped ID: 321
Dune Nice book ID is 999 None
I would like to search the column "ID number" from Sheet1 inside the text in the columns "Comment", "Comment2" and "Comment3" from Sheet2, and return the whole row from Sheet2 of the IDs that don't match.
So, in this case, the return would be:
Dune Nice book ID is 999 None
I have been trying the vlookup, I know how to search inside a text, and how to search inside multiple columns, but I don't know how to mix both processes
It looks like you have two problems.
Your ID or key to link the two spreadsheets together must match the data type. For example, one sheet you have ID number: with a list of only numbers. The other sheet you have text and numbers.
Try Xlookup instead.
Both columns you're using as the matching key has to be the same data type (letters or numbers)
First, use Text to columns (in tools, Data - text to columns) to separate your ID numbers from the rest of your text string in your sheet 2 columns that contain the Id numbers.
= Xlookup(CellwithfirstIDnumber,Columnfromsheet2tosearch, Column from sheet2tobring back, "no match")
Good luck

Search for duplicate text string in two columns and highlight, excel

I'm looking for a way to search and highlight duplicate text strings in two different columns in Excel; this means that the cell content doesn't have to be identical, instead of that is what I need is that if the content of column A is somehow contained in any cell of column B, both cells get highlighted.
For example, let's say that I have two columns, one named "Patient" and another one called "Couples". So, what I would need is to make a comparison between both columns, and if one of the patient's names is within a couple, both cells get highlighted:
Column A. Patient name | Column B. Couple name
John Smith | Adriana Lewis - Mark Rutte
Peter Brown | Giaccomo Down - Rosy Lawn
Jerry Goldsmith | Bob Loewe - Gigi Pink
Ewan Thompson | Sonia Farrel - John Smith
In this example, the content of A2 ("John Smith") is also contained in B5 ("Sonia Farrel - John Smith"), so that I would need that both A2 and B5 get highlighted. Also, both columns don`t have the same range, one is shorter than the other, since there are more names than couples; and it can happen that two names in different cell are contained in a single couple, so that all three cells should get highlighted.
I have tried everything, with no success... please help!
Multiple ways to do this but here's one option with conditional formatting.
Rule applied to data in column A, using COUNTIF and wildcards.
=COUNTIF($B$2:$B$5,"*"&A2&"*")>0
Rule applied to data in column B, using ISNUMBER, SEARCH and SUMPRODUCT.
=SUMPRODUCT(--ISNUMBER(SEARCH($A$2:$A$5,B2)))>0

Match 1:many on excel

I have an excel file that contains links with unique IDs, an example is as follows -
file://allthefiles/1234/picture1.jpg
file://allthefiles/1234/picture2.jpg
file://allthefiles/1233/flower.txt
file://allthefiles/1237/work.doc
I have another CSV file, that contains (only one instance of) these unique IDs -
Type IDs
x 1233
y 1237
z 1234
What I want to get is -
Type IDs links
x 1233 file://allthefiles/1233/flower.txt
y 1237 file://allthefiles/1237/work.doc
z 1234 file://allthefiles/1234/picture1.jpg
z 1234 file://allthefiles/1234/picture2.jpg
So as you can see, since there are two different values for '1234' another value field was created.
I tried to match via excel, but this is not working. How can I do this using vlookup?
This would not be practical if there are many rows in the CSV file but is for the three that are shown. This assumes links are in ColumnC starting in Row1 and a copy of the CSV file's three rows is in the sheet in a table named CSVfile with its first column named CSVc1. In A1:
=INDEX(CSVc1,IFERROR(SIGN(FIND(1233,C1)),IFERROR(2*SIGN(FIND(1237,C1)),3)))
in B1:
=VLOOKUP(A1,CSVfile,2,0)
with both copied down to suit and ColumnA:C sorted by Column A A to Z then by Column B Smallest to Largest.

Excel look up value in array, return next value

I would like to look up a value in a range and return the value in the next row, but can't quite figure out how to do this. I especially would like to do this with formulas rather than VBA, and preferably with built-in formulas than custom (VBA) formulas, due to macro security issues.
I'm using Excel 2010. My workbook has two worksheets, "assessment" and "lookup". In lookup, I have lookup tables.
"lookup" looks something like:
Column A Column B Column C
1 Sales Engineering Manufacturing
2 Alice Bobbie Charlie
3 Dawn Edgar Frank
4 George Holly Isabel
In "assessment," I have some some drop downs from which users select one name from each column in "lookup." Based on some other criteria, I then rank these and create a new, sorted list (using INDEX() and MATCH()) that produce the selected name and corresponding column name a new sort order
Column A Column B
10 Engineering Edgar
11 Sales Alice
What I'd like is to return the name from the next row.
Column C
10 Holly
11 Dawn
But I'm having real trouble figuring out how to get there.
Assuming lookups is located at B2:D5 (change as required) and the result data is at F2:H3 (change as required) enter this formula in cell H2 then copy down.
=INDEX(
INDEX($B$2:$D$5,0,MATCH($F2,$B$2:$D$2,0)),
1+MATCH($G2,
INDEX($B$2:$D$5,0,MATCH($F2,$B$2:$D$2,0)),0))

Comparing two columns in Excel

I have data with about 15 different columns and a total of 2400 rows.
The two columns I'm interested in: (Column C = Application Owner & Column D = Application Tester). I'm trying to see which rows have the same name for both columns.
E.g.
Column C =
Mike
Bob
John
Bob
Adam
Column D =
Mike
Barry
Barry
Barry
Adam
So for this example I would like it to delete the contents of the three middle rows and only show me the first and fifth row because that is what I'm concerned with. Can anyone suggest a function of code or a function in Excel in which I can do this without actually having to go through all of them row by row?
Thanks
Add a column with something like =C2=D2 copied down to suit, filter for FALSE in that column and delete rows.
In a new Columns you can use =if(C2=D2,"DELETE","") then filter out this new column for DELETE and delete the values from column C and D or the entire range

Resources