Excel How to organize repeating data - excel

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.

Related

What is the formula for displaying a value if another value is in the same row in Excel?

I am trying to create a formula that populates the Location # value of the person that is in the same row and only if the person is in the Location Manager or the Assistant Location Manager columns. The screenshots show two different tabs of information. I am trying to populate the Location# cell in the first screenshot. Data will be pulled from the second screenshot. The formula should populate COL-04 for Jane Doe and COL-01 for John Doe. If they aren't in the two columns, then the cell should stay blank (" "). I hope I explained things clear enough. Thanks
[
IfError is not working properly.
Assuming both the data starts from A1 and the LOCATION DATA sheet is named Sheet1, this should return the correct values:
=IFERROR(IFERROR(INDEX(Sheet1!A:A,MATCH(B1,Sheet1!C:C,0)),INDEX(Sheet1!A:A,MATCH(B1,Sheet1!D:D,0))),"")
Formula not tested, might be missing a bracket or comma:
=IF(B1=" ","",IFERROR(IFERROR(INDEX(Sheet1!A:A,MATCH(B1,Sheet1!C:C,0)),INDEX(Sheet1!A:A,MATCH(B1,Sheet1!D:D,0))),""))

Combining 2 workbooks into 1 worksheet based on common row value

I have two workbooks, one with Email and IP values and the 2nd one with Name and IP Value.
I'm trying to combine these two workbooks into one and to fit the names and emails to common IP's.
Screenshot: http://take.ms/0Y3wv
Example:
Workbook 1 has:
jack123#gmail.com 1.1.1.1
emilly444#gmail.com 2.2.2.2
Workbook 2 has:
John 12.12.12.12
Jack 1.1.1.1
Emily 2.2.2.2
The result should be:
(Discard John cause we don't have his IP in the 2nd workbook).
jack123#gmail.com 1.1.1.1 Jack
emilly444#gmail.com 2.2.2.2 Emily
This is yet another job for the Vlookup function.
First, something that could be done to make your life easier (personal experience) is to put the common column of data in "A" column position of Workbook 2.
If you want the output (with both data from Workbook 1 and 2) be output to Workbook 1, just use Vlookup:
On column 3 (row 2) of workbook 1 (assuming your data is organized as in your example, and that, on Workbook 2, your column A has 1.1.1.1):
=Vlookup($B2,'Workbook2'!$A$1:$B$3,2,False)
Then drag the formula down to all the rows that have data.
What this code does:
1: $B2 will select the identifier in the Workbook 1
2: 'Workbook2'!$A$1:$B$3 will select the range where the data will be looked up (here you should just click on the workbook you want and select the data, than click "," and click back on the Workbook 1). Also, I used fixed references ($) so you could drag down the formula.
3: 2 is the column from which the function will retrieve the data.
4: False is just for an exact match.
You could do this for more columns of data, just pay attention to the identifier and to which column you are getting the data from.
For the data that is missing, you could write an if function in VBA to delete the row if a certain cell is #N/A (which will be the result you get, if you use the vlookup).
A simple INDEX MATCH formula will do what you want,
=INDEX(Sheet2!A:B,MATCH(B1,Sheet2!B:B,0),1)
This formula gets the required data from Sheet2. Now I leave the rest for you to google and find out how to get the data from a different workbook. Thats an easy task and a minute change to the formula. Let me know if you face any difficulty.

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

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.

Use a sheet name based on Column Value

Using Google Sheets or Excel:
I have columns (B) with Stock symbols, e.g.: B2=GOOG, B3=AAPL, B4= MSFT
I have Sheets named with these same stock symbols respectively. Eg: Sheet2: GOOG, Sheet3: AAPL, etc
I have a formula on Sheet1 that does some computation using data in other sheets. Eg: K2=((GOOG!B2+GOOG!B5)/GOOG!B24)
----I want to automate grabbing the correct sheet name based on column B without manually typing in the sheet name into this formula.----
Is there a way to input the sheet name in this formula K2=((GOOG!B2+GOOG!B5)/GOOG!B24) based on column B in sheet1?
Conceptually something like K2=((*indirectB2*!B2+*indirectB2*!B5)/*indirectB2*!B24)
In other words, how does one input a sheet name into a formula based on a string in a column
My example image is a tad different than mentioned above but same idea:
I solved this using =INDIRECT("'"&B4&"'!$B$2")+INDIRECT("'"&B4&"'!$B$5"))/INDIRECT("'"&B4&"'!$B$24")
Would K4=((B4&!C43+B4&!B5)/B4&!B24) work?

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