Matching up information on Excel from 2 different sheets - excel

In the next step of the analysis I'm currently working on I have one sheet with two important columns. Column A specifies gene name and Column B specifies a number I am interested in (first screenshot). Then, I have a second sheet that repeats Column A but the gene name entries are in a different order to the first sheet and a Column B which has a lettered classification system (A-Z) which gives me some detail regarding the function of that gene. I would like to match the Column A and Column B data from sheet 1 to the Column B data from sheet 2 but as the column A in both sheets is the same but in a different order, is there a way to get Excel to match the correct letter in the second sheet to the correct gene name and number in the first sheet? The screenshots are of fake test data just to help me clarify this text! Any help really appreciated.

Use Index/Match() like below-
=INDEX(Sheet2!$B$2:$B$20,MATCH(A2,Sheet2!$A$2:$A$20,0))
VLOOKUP() will also work
=VLOOKUP(A2,Sheet2!$A$2:$B$20,2,FALSE)
If you have Excel365 then use XLOOKUP() function.
=XLOOKUP(A2,Sheet2!$A$2:$A$20,Sheet2!$B$2:$B$20,"Not Found")

Related

Using two values in a sheet to filter and return values from a table in another sheet

I'm fairly new to coding and i've been googling around for the last few hours trying to solve this problem but it seems to be a little beyond what i'm able to do so i would be very grateful for some help
In Sheet1, I have a table which has columns between M - CV (175 columbs). For each column, i have an "ID number" value in row 3. From Row 6 to the end of the table, i have several "search terms" separated by commas in the column CV
In Sheet2, the corresponding "ID Numbers" are in column B. Column AN contains strings.
For each ID Number value in sheet1, i'm looking to find find all the corresponding cells in sheet2 where the ID number in Column B is the same, and Column AN of sheet2 contains at least one of the "search terms" in column CV
For each ID number, i'm hoping to join the entries in Column AN of sheet2 which match the criteria above and paste them into Row 5 of the respective column in Sheet1
I've gone around in quite a few circles trying to do this and i'm back to square 1 with no code to show for it.
I've tried to research both the autofilter function, and using for loops. The research i've done indicates that for loops are rather slow to run for a large data set.
I'm hoping to find a solution which is as easy to read and understand as possible
I hope i've given enough information for everyone to understand and help
THank you in advance
My Excel subscription has expired an I've started using Google Sheets for most of my spreadsheet work, so I tested this there. Some conversion may be required. I did this using formulas, not VBA also, not sure if that changes things for you.
If I understand correctly, you have two sheets with a shared key column, sheet 1 contains search terms across multiple columns, and sheet 2 contains search terms comma delimited in a single column.
With this setup we want to bring the search term column of sheet 2 into the correct row of sheet 1 by key using VLOOKUP. I made a named range in sheets which contained all my data on sheet 2 and called it "dst". My formula was then =VLOOKUP(A2, dst, 7, true) since my key in sheet 1 was in column A, dst was the range I was searching, my column with my delimited search terms was column 7 in relation to dst, and I had ordered sheet 2 by key. I pasted this formula relatively down all rows as needed.
We want to construct a regex string using our search terms across multiple columns in sheet 1, into a single cell. I used =JOIN("|", B2:E2) on sheet 1 since my search terms were in columns B:E, and this resulted in a regex that looked like this for me: alligator|dog|rabbit|lizard where alligator, dog, rabbit, and lizard, were all search terms in that row. Paste down relative as needed.
We want to run our regex against our search target cell containing the comma delimited search terms. I ran =REGEXMATCH(F2, G2) where F2 was my delimited search terms from sheet 2, and G2 was my constructed regex for the row. Paste down relative as needed.
A screenshot of my completed sheet 1:
Once you know which cells have matches you can do whatever you want.

Excel- Find matching values then compare additional respective values

I have been struggling with creating a complex formula to accomplish the following:
I am using 2 sheets of data within a workbook. I want to first find exact account number matches between the two sheets. (ie. On sheet two there are specific accounts I want to find in sheet 1- which holds all account numbers) I think I accomplished this with formula =COUNTIF('Sheet 2"!$A:$A,F1)>0 [account numbers are in column "f" in sheet 1] - they are all currently highlighted in sheet 1.
I now want to take those matches and compare the respective values listed in each separate sheet. (ie. I have now found all the accounts I need in sheet 1. Lets say account ABC is one account of interest. ABC's value is in column B of sheet 2. I want to compare the value I have listed in column C of sheet 1 to see if it is < or =.
I am not that advanced in excel formulas; you all are way smarter than I, so hoping you can help!
Thanks in advance

Excel: Four columns with different lengths and data values, need to find matching values

I have a sheet with 4 columns of data. The first two columns show the name of a stock, followed by a PipDigit. These two values are connected and must not be seperated. The other 2 columns are another set of stock names and accompanying PipDigits. I want to do several things:
First, compare the stock names in each column and arrange it in such a way that matching stock names are aligned. The columns have different lenghts.
Second, I want another column to display which matching stocks have different PipDigit values. For example if for an Ebay stock I have a PipDigit of 2 in the first set of columns, and a PipDigit of 4 in the second set of columns, I would like to see message saying "different" or something similar. I have included a screenshot of the file.
If anything is unclear please let me know
This is the file in question
I believe from your question you are looking for the corresponding record in columns E/F for the 'Symbol' in column A.
The easiest way to get this data would to perform a VLOOKUP on the first column, looking at the data in columns 3/4.
In cell C2 you want the following formula:
=VLOOKUP(A2,E:F,2,FALSE)
This will give you the corresponding pip-digit from column F.
Now in cell D2, enter the following formula:
=IF(B2=C2,True,False)
This will give you a column telling you whether the pip digits match.
Drag these two formulas down to replicate for each row of the table on the left.

Combining Like Data in Excel

So here is my situation: I need to take two spreadsheets in excel and combine the data together so that any additional data is paired up with common data between the cells. Here's an example of what I mean.
Sheet 1
1234567, JOHN, DOE, 1234567.JPG
Sheet 2
JOHN, DOE, 6634
First and Last names are common data, but the number in the second sheet does not exist in the first. The user list in both sheets are slightly different from each other so I can't simply alphabetize the names and move the additional column over. I have about 500 users to go through and may have to use what ever solution I come up with for similar lists of users.
Any assistance would be great.
There's various techniques you can use to combine data but you'll have to be a bit more specific. For example is there a fixed number of columns that sheet 1 doesn't have that sheet 2 does?
The basic technique would be to create some sort of unique identifier, perhaps by concatanating the names together in both sheets? that way you can use VLOOKUP to put all the missing data in one sheet into the other
Not sure I understood "I cant alphabetize the names". However, if the names have the same spelling i.e John is John in both sheets you can concatenate John and Doe in sheet 1 and do same in sheet 2 and use a vlookup function. Something like
A=cellcontainingJohn&CellcontainingDoe in sheet1
B=cellcontainingJohn&CellcontainingDoe in sheet2
C= Vlookup(A,rangeforB,columnnumber)
Here's what I would do:
Select the sheet into which you want to pull data from the other. I'll assume we're pulling data from sheet 2 into sheet 1.
In sheet 2, insert a column to the left of what you have already. JOHN is now in column B, DOE in column C, and 6634 in column D.
In sheet 2, column A, row 2 (assuming you have a row of column headers) which is currently empty, use the formula
=CONCATENATE(B2,C2)
Now, head back over to sheet 1. Let's assume you also have a row of column headers in sheet 1, so the cell immediately to the right of your 1234567.jpb is E2 and it's empty. In E2, use the following formula
=IFERROR(VLOOKUP(B2&C2,'Sheet 2'!$A:$D,4,FALSE),"")
That should give you what you're asking for, if I understand your question correctly.

SUMIFS + VLOOKUP tricky use in excel

I've got two files with excel sheets
The first one consists of 2 columns
First one is ARTICLE (with article numbers), second one is QUANTITY (with product quantity)
Second file consists of two sheets
First sheet contains two columns is CODE (code numbers), second one is QUANTITY (with product quantity)
Second sheet consists of two columns CODE and ARTICLE
The thing is one code, for instance "2111", can contain up to 5-10 different articles
My goal is to find the right articles in the first file depending on the code in the second one and calculate the quantity in the second one.
THANK YOU SO MUCH for any insights!
Assume Article & Quantity are in column A and Column B, Code and Article are in columns E & F, Code and Quantity are in columns I & J.
Add a VLOOKUP formula in column G
=VLOOKUP(F2,$A$2:$B$4,2,FALSE)
and fill down.
in column J (this is is the answer column) add a SUMIF Formula:
=SUMIF($E$2:$E$7,I2,$G$2:$G$7)
and fill down
(your row numbers in the formulas will be different)

Resources