EXCEL - Match values from one sheet to another and then paste results - excel

I'm trying to make the most user-friendly excel spreadsheet I can. This spreadsheet takes a name that the user puts in for a client, sometimes a first name and sometimes first and last. I have another sheet with the full list of clients, first and last names.
What I need to do is look at the user input, match that name to the client list sheet, and then paste that into the original sheet.
Example:
USER SHEET
A
1 Jane
2 Helen Smith
3 John
CLIENT LIST SHEET
A B
1 Johnson Jane
2 Smith Helen
3 Brown John
I need the User Sheet to look like
A B
1 Jane Johnson, Jane
2 Helen Smith Smith, Helen
3 John Brown, John
I know this might be a complicated formula, I've tried to write a whole bunch of different ones but none of them are really doing what I need them to.
Most of the problem is that I need other people I work with, who don't know how to use excel and sometimes aren't able to write the full names, to be able to use this spreadsheet once I have a generic formula in there, and all that would need to be changed is the Client List sheet.
Hopefully I provided enough detail in here. Thanks for any help you give me in advance, super appreciate it. If I find a solve I'll post it.

I have an idea. In your Client sheet, in the third column build a formula that combines first & last name, like:
=B1&" "&C1
Then select the range of names (columns A:C) and Insert Table (without headers). You can enter the header labels later:
From the Formulas Ribbon, open the Name Manager. Define a new name called "ClientNames" and have it refer to the fullname column (modify the Refers To formula based on your table's name & column header name):
Then, on your User Sheet, select column A, and from Data ribbon Data Validation. Allow "List" and set the "Source" formula to =ClientNames.
Finally, instruct your users to choose a client name from the validation list. This will prevent them from making bad inputs and also enforce a standard against the "Users" worksheet.
If you still need the formatted LastName,FirstName in column B, then do a formula:
=RIGHT(A1,LEN(A1)-FIND(" ",A1))&", "&LEFT(A1,FIND(" ",A1)-1)

This formula might be looking too complex but it is simple,
use this in column B of your user sheet and drag across the rows.
=IFERROR(INDEX(Sheet2!A:B,MATCH(LEFT(A1,LEN(A1)-FIND(" ",A1)),Sheet2!B:B,0),1)&", "&INDEX(Sheet2!A:B,MATCH(LEFT(A1,LEN(A1)-FIND(" ",A1)),Sheet2!B:B,0),2),IFERROR(INDEX(Sheet2!A:B,MATCH(LEFT(A1,LEN(A1)-FIND(" ",A1)),Sheet2!A:A,0),1)&", "&INDEX(Sheet2!A:B,MATCH(LEFT(A1,LEN(A1)-FIND(" ",A1)),Sheet2!A:A,0),2),IFERROR(INDEX(Sheet2!A:B,MATCH(A1,Sheet2!B:B,0),1)&", "&INDEX(Sheet2!A:B,MATCH(A1,Sheet2!B:B,0),2),IFERROR(INDEX(Sheet2!A:B,MATCH(A1,Sheet2!A:A,0),1)&", "&INDEX(Sheet2!A:B,MATCH(A1,Sheet2!A:A,0),2),""))))
This formula is for A1, you can modify it if you want to start from searching A2. Let me know if you need help. This might look big but its very useful for dragging across ranges.

Related

Compare Four Columns and Return Label

I'm trying to compare membership rosters which contain 2 columns each for first name and last name. If the names match I want to add conditional formatting and a value in a 5th column. (I'm trying to determine who is a member and who is an external contact.)
I've tried to adapt some formulas found here but no luck.
For example:
If Jon and Doe exists in A & B and C & D on any row as long as Jon and Doe are together in both columns, than I would like to add conditional formatting to Jon and Doe in column A & B and add the word "Member" in a separate column. If Jon Doe only exists in columns A and B, then add the word "External" instead of Member. My example image can explain better.
I got this close but am not able to adapt it to use labels much less conditional formatting. I'm happy to ditch conditional formatting if it's too complex.
=INDEX($N:$N,MATCH(1,(A2=$L:$L)*(B2=$M:$M),1))
Conditional Format Formula, applied to A2:B4 in the sample data
=IFERROR(MATCH(1,($A2=$C:$C)*($B2=$D:$D),0)>0,FALSE)
Status Formula
=IFERROR(IF(MATCH(1,($A2=$C:$C)*($B2=$D:$D),0)>0,"Member",""),"External")
Note the $'s anchoring A and B columns

Excel How to organize repeating data

I've got an massive excel (2010) file that is organised like this:
Column1 Column2
Name John
Surname Doe
Address smth1
....
Name Janet
Surname Smith
Address smth2
....
Etc
Now I want to convert it into normal tables with proper headers so it looks like this:
Name Surname Address ....
John Doe smth1
Janet Smith smth2
PS It's my first time posting here. Hello everyone!
You can copy all the data to another sheet in the workbook by putting the following formula into cell A1 in a new sheet and copying it across and down.
=OFFSET(Sheet1!$A$1,3*(ROW(A1)-1)+COLUMN(A1)-1,1)
I have made the assumption that your data is in Sheet1 and it starts at cell A1. Change Sheet1 for the actual name of the sheet and change $A$1 for the actual start of the data in the sheet (the $ signs are important).
I also assume there are 3 pieces of data for each person. If there are more, change the number 3 in the formula to the number of pieces of data.
Once you have used the formulas, if you want to make the changes permanent, copy the new data and paste as values. this will destroy the formula but leave you with the data intact.

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!

Need to list all names in a column in multiple sheets and the percentage associated with each name

Sorry for the confusing title, but I don't know how else to phrase it. I'll just explain.
I have a document with hundreds of entries. Each sheet is identical, but one sheet per month of information (ie. May, Jun, Jul, etc.)
In each sheet, there's some unrelated information, a Name (ie. joe, Jim, Rob, etc.) and a column with either yes or no. On a separate sheet, I want to have a list of all unique names that appear, and the percentage of times that Yes appears associated with that name. I'm not sure what kind of formula will reference multiple sheets for the same info.
Example of the layout of a sheet
Joe Yes
Jim No
Joe No
Russ Yes
Chris No
Russ Yes
Joe No
If this doesn't make sense, I'll try and clarify.
Thanks for your help.
If you can get a list of the names the following will result in the correct percentages:
First create a named range that includes all the sheet names that have the data:
I called mine sheets
Then in the output sheet I listed the unique names in Column A. In B2 I put this formula:
=IF(A2<>"",SUMPRODUCT(COUNTIFS(INDIRECT("'" & sheets & "'!A:A"),A2,INDIRECT("'" & sheets & "'!B:B"),"Yes"))/SUMPRODUCT(COUNTIF(INDIRECT("'" & sheets & "'!A:A"),A2)),"")
It will loop through all the sheets looking for the correct data, summing the results as it goes. It will divide the counts of all that have 'Yes' for the specified name and divide it from the total counts of the name.

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.

Resources