Excel- Find matching values then compare additional respective values - excel

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

Related

Matching up information on Excel from 2 different sheets

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")

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.

amounts and ageing in excel

I have two excel files that I need to cross reference amounts in.
The first sheet looks like the below:
what I need to do is find any amount that are contained on sheet 2 and the month they fall into.
Sheet 2 looks like below:
for example on sheet 1 I have 56.49 in column C for reference AK1080117 in column A and this shows as Person 8 on sheet 2.
I can see this is correct as on sheet one it has a transaction date of 08-jan and on sheet 2 is in the column JAN.
There is no same ref that can be used between sheet 1 and 2 as sheet 1 has Reference and sheet 2 has Name.
Can anyone advise the best way to do this.
The complete sheets are hundreds of lines long.
Many thanks,
Note: Make sure your data has unique values AND it is not exceding the year 2017
If so, I have found a way to maybe do this in a few steps:
1: Add another column E to your first sheet and add this formula to second row of the column and drag it all the way down:
=SUBSTITUTE(ADDRESS(1,MONTH(B2)+1,4),"1","")
2: Now create another column F next to the freshly made one and put this formula in second row:
=MATCH(C2;INDIRECT("Sheet2!"&E2&":"&E2);0)
3: Now create a third column G and put this formula in second row to be dragged down:
=INDEX(Sheet2!A1:D15;F2;1)
4: Now you have created a cross-reference because column G will show you the person with a match.
Edit: You can combine the three formulas direclty obviously but my personal preference is to brake things down to make them easier to understand :)
=INDEX(Sheet2!A1:D15;MATCH(C2;INDIRECT("Sheet2!"&SUBSTITUTE(ADDRESS(1,MONTH(B2)+1,4),"1","")&":"&SUBSTITUTE(ADDRESS(1,MONTH(B2)+1,4),"1",""));0);1)
Good luck with it!
You need a third table that has Reference and Name. Then you can use lookup functions or table relationships to link the data together.
Ask the source of the first table to include Name as a field.

MS Excel - Match 3 columns between two sheets. When matches are found, copy a 4th column from each to a third sheet

When the all three columns "Last Name, First Name and DOB" match on any rows between the 2 sheets, I need to have the account numbers from the matching rows listed on a third sheet. There are thousands of rows in each sheet. There will likely be multiple matches for some accounts. I prefer to put the functions on the 3rd sheet so that I can change out the lists in the first 2 sheets without needing to update them.
Sheet1
Acct # Last Name First Name DOB
89158 Stevens John 1/23/2012
Sheet2
Acct # Last Name First Name DOB
124578 Stevens John 1/23/2012
Sheet3
Sheet1 Acct # Sheet2 Acct#
89158 124578
Thank you in advance!
This works with duplicate values
The formula will need to be entered as an array (once copy and pasted while still in the formula bar hit CTRL+SHIFT+ENTER) and the range adjusted to fit your total values.
=IFERROR(INDEX(Sheet1!$A$2:$D$50,MATCH(1,($C2=Sheet1!$B$2:$B$50)*($D2=Sheet1!$C$2:$C$50)*($E2=Sheet1!$D$2:$D$50),0),1),"No match found")
The exact same formula can be used again changing Sheet1! to Sheet2!.
This will search for the last name that is in Sheet3!C2, first name that is in Sheet3!D2 and the DOB that is in Sheet3!E2.
I have only locked off the column in case you are looking to use this for a large volume of data and wish to drag it down.
If you want to display the additional account numbers that meet the search criteria and are only using sheet 3 to search for one person, then you will need to look at using INDEX(), MATCH() and SMALL().
I had looked to include this alternative in my answer too but I am now leaving the office. It won't take me long to conjure if you struggle so drop me a comment and I will be happy to explain how it all works.
EDIT: To list all ID's found for the search criteria - Leave blanks where not found
=IFERROR(INDEX(Sheet1!$A$2:$D$50,SMALL(IF(COUNTIF($C$2,Sheet1!$B$2:$B$50)*COUNTIF($D$2,Sheet1!$C$2:$C$50)*COUNTIF($E$2,Sheet1!$D$2:$D$50),ROW(Sheet1!$A$2:$D$50)-MIN(ROW(Sheet1!$A$2:$D$50))+1),ROW(Sheet1!1:1)),1),"")
Again, replace sheet 1 for sheet 2 and update the ranges to match what you are searching through, use CTRL+SHIFT+ENTER in the formula bar to make the formula an array then you can drag it down to cover all the potential matches, best to aim for what you believe would be the highest number of duplicate IDs.
Let me know how you get on, if this answers your question, please mark this as an answer using the tick to the left, thank you.
I ended up putting list A and List B into a sheet and then using this formula: =ISNA(MATCH(B2&C2&D2,I:I&J:J&K:K,0)) Then I created another sheet where I added list B and then list A and used the same formula. Once the calculation was complete for each sheet, I used filters to only list the matches for the first lists in each spreadsheet.
I then took the matches for each sheet and listed them side by side in the third sheet. I made sure the sort was matched between the two lists and then was able to scroll through a page at a time and identify a few users with multiple account numbers in each system.
It's not as automated as I would like, but it is done for now. Thank you Stack Overflow!

excel - advanced vlookup or other formula?

I have a question regarding excel and I am looking for a formula that can help me transport my data from one sheet to the other. I have some experience with excel, however I am not a pro at it, so I apologize if this is a very trivial question but would also be happy since that would mean it probably has a very trivial answer! Unfortunately I do not have enough reputation points yet to post images, but I will try to explain it as clearly as possible.
Basically I am creating an excel template and the goal is to have 2 sheets in excel.
In the first sheet I have a column with following input in rows A1 - A3: Sales Region,
Country, Account ID's.
Above is the example of column A; from column B --> x; I will put e.g.
Americas, US and as many account numbers as there are in that specific country.
However on the second sheet it gets a bit complicated. My goal is that all the account numbers from sheet 1 irrespective of their sales region and country (which also means irrespective of their column) will automatically be listed on the second sheet.
The second sheet will be organized in the following way:
From column A - C; sales region, country and account ID.; from column D - x financial information for each account.
As a first step I want all the different account ID's from the different columns on the first sheet to be listed under column C (account ID's) on the seconds sheet.
As a second step I want column A - B to be automatically filled out according to account number by accessing the information in which column and thus sales region and country the account is in on sheet one.
I don't think a simple vlookup would do the job, especially for step 1, since I want the account ID's from many different columns and rows in sheet 1 to be listed in just one column....
hope it is clear enough! Would appreciate any help! :) thanks in advance!
The first step take all of column A and copy it to the 2nd sheet on column C.
Select data ribbon and select remove duplicates.
For column A insert vlookup for column C for all the data in 1st sheet
For column B insert vlookup for column B for all the data in 1st sheet
Those value will work well only if an ID has one valid Region and country.
Now just use custom sort to sort it in the way you desire.

Resources