Match 1:many on excel - 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.

Related

Excel need to find exact matches in two columns compared to two other columns in a different sheet

I have two worksheets with data from two different years. I have data in columns A and B in sheet 1 with names of groups (column A) and individuals (column B). I need to find all of the data in sheet 2 that matches sheet 1. For example, say in sheet 1 Row A contains company X and Row B contains individual Y. I need to find if in sheet 2 there are any instances of the exact combination of company X and individual Y.
Let me know if I need to elaborate, having trouble explaining this one

Excel Conditional Statement to determine which rows to delete and which to keep

I have 2 excel sheets containing data that will help me determine whether or not I need to delete or keep a row. Essentially, the way it works is that I have Column A in both sheets of the data which contains a code and column B of sheet 2 contains either a value of the text "Free". For each code in column A of sheet 1, I want to check if the same code exists in column A of sheet 2, and if so, I want to then look at column B of sheet 2 on that same row, and if it's cell contains "FREE" I would like to delete the entire row in containing that code from sheet 1.
Sheet 1: Sheet 2:
A B C A B C
1234 Data Data 1234 FREE Data
1235 Data Data 1456 Value Data
1547 Data Data 1547 Free Data
1483 Data Data 1247 Value Data
Then we Would get:
Sheet 1: Sheet 2:
A B C *Decision A B C
1234 Data Data Delete 1234 FREE Data
1235 Data Data Keep 1456 Value Data
1547 Data Data Delete 1547 Free Data
1483 Data Data Keep 1247 Value Data
This is what I have tried, but there is an error here I can't figure out. I am assuming I am doing something wrong with the syntax. HS is the name range of column A of sheet 2
=IF((VLOOKUP(A2,HS,1) = A2) and (Vlookup(A2, HS, 2) = "FREE"), "delete", "keep")
Try with below formula. It will work
=IF(ISNA(MATCH(A1,Sheet2!A:A,0))=FALSE,"Delete","Keep")
Proof of Work
EDIT #1
As per the request, please see the sheet 2 formula
=IF(ISNA(MATCH(A1,Sheet1!A:A,0))=FALSE,"Delete","Keep")
Your AND is in the wrong place. It should start the multiple conditions and each condition needs to be separated by a comma:
=IF(AND((VLOOKUP(A2,HS,1) = A2),(Vlookup(A2, HS, 2) = "FREE")), "delete", "keep")
Does this accomplish what you are looking for?
=IFERROR(IF(VLOOKUP(A3;Sheet2!$A$1:$C$5;2;FALSE)="Free";"delete";"keep");"keep")

Equation/ sorting to separate one long column of data into separate columns

I have two columns of data in an excel spreadsheet that is listed like, each date has three numbers associated with it. It is shown like this:
1 112
1 123
1 456
2 788
2 989
2 901
What I am trying to do is have the data shown like this:
1
112
123
456
Then in another column next to it have;
2
788
989
901
Okay, this can be done pretty easily/quickly.
First, select your entire column that has # ### and go to Data --> Text to Columns, and choose “Delimited”, then use a “Space” delimiter. This will separate your numbers by the space, so 1 and 2 will be in Column A, and the three digit numbers are in B (or wherever you decide to put them).
Then, just get the unique values from column A. I tend to copy the entire column to a temporary column (or worksheet), then highlight them and go to Data --> Remove Duplicates. Now you have a list of unique numbers. Copy and paste these (transposing) into (for example) column D.
Then, in D2, enter this formula (adjust ranges as necessary) as an array, using CTRL+SHIFT+ENTER:
=IFERROR(INDEX($B$1:$B$6,SMALL(IF($A$1:$A$6=D$1,ROW($B$1:$B$6)-ROW($B$1)+1),ROWS($B$2:$B2))),"")
Here’s a screenshot of the final output:

Merging data from two excel spreadsheets

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.

Index/Match multiple columns in Excel

I have 2 sheets. Sheet 1 is set up similarly to:
Keyword Domain Rank
A Z 1
B Z 2
C Z 3
D Y 10
E Y 15
B Y 20
And sheet 2 is set up like:
Keyword (Domain Z) (Domain Y)
A 1 -
B 2 20
C 3 -
D - 10
I'm trying to have a formula that will compare the keywords in Sheet 2 with those in Sheet 1 and then return the rank that corresponds to the correct domain (that's specified in Sheet 2 for that column). I can't get any formula I use to evaluate. I've used 2 formulas so far:
=INDEX(Raw!$H$11:$H$322, MATCH(A3,IF(Raw!$D$11:$D$322=All!$B$2,Raw!$B$11:$B$322),0))
The above formula works, to a point. The problem is that it simple pulls the domain for the first instance of the keyword found, which doesn't always match the domain in the column of sheet 2. The second formula I've tried:
=INDEX(Raw!$H$11:$H$322, MATCH(B3,MATCH($C$2,Raw!$D$11:$D$322,0)))
To make the values appear in the Sheet 2 table, use the following formula:
=SUMPRODUCT(--($A$2:$A$7=E2),--($B$2:$B$7=$F$1),$C$2:$C$7)
This returns 0 for non-matches - you can either format the cells to display 0 how you want, or you can use the longer/uglier:
=IF(SUMPRODUCT(--($A$2:$A$7=E2),--($B$2:$B$7=$G$1),$C$2:$C$7)<>0,SUMPRODUCT(--($A$2:$A$7=E2),--($B$2:$B$7=$G$1),$C$2:$C$7),"-")
To calculate the rank on the first sheet based on the data from the second sheet:
=VLOOKUP(A2,$F$2:$H$5,MATCH(B2,$G$1:$H$1,0)+1,FALSE)
For sample purposes, this just put your sheet2 data in F1:H5.
This looks for the corresponding keyword and then uses match to pick the right column. I named the columns Z and Y, but if you need Domain included that can be done as well. Note that this causes an error since there is no E defined in your second table - is that the case? If so, it can be adjusted to account for no matches as follows (assuming Excel 2007):
=IFERROR(VLOOKUP(A6,$F$2:$H$5,MATCH(B6,$G$1:$H$1,0)+1,FALSE),"Rank Not Found")
You could also use PivotTable with Keywords in rows and Domain names in columns. It seems like that would do the job and be a more robust solution.

Resources