Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
How do I transpose multiple columns of data for one person into a single row?
There's no way I can describe this adequately in the question line.
I was given a spreadsheet. I was trying to get a spreadsheet of student names in one column, and down the row for each students, a list of classes in order of preference for the coming year.
The problem is, they gave me a list where the classes were arranged vertically.
Here is an example. I was given the list this way:
Student 1 | Class 1
Student 2 | Class 1
Student 2 | Class 2
Student 3 | Class 1
Student 3 | Class 2
Student 3 | Class 3
Student 3 | Class 4
Student 3 | Class 5
Student 4 | Class 1
Student 4 | Class 2
Student 4 | Class 3
.....
What I need is a list like this:
Student 1 | Class 1
Student 2 | Class 1 | Class 2
Student 3 | Class 1 | Class 2 | Class 3 | Class 4 | Class 5
Student 4 | Class 1 | Class 2 | Class 3
.....
Is there any way to convert the top to the bottom quickly? I could use transpose, but we're talking about thousands of individual students. I need something a bit more automated.
This is a Microsoft Excel question. I have Excel 2007 specifically.
1 Answer
- IXL@XLLv 71 decade agoFavorite Answer
Col A students, col B classes (no headers please).
In C1 enter =IF(COUNTIF(A$1:A1,A1)=1,ROW(),"")
In D1 enter =A1&B1 Copy down list both cells.
In F1 type STUDENT, in G1 to K1 type Class 1, Class 2 etc (exactly as they appear in col B)
In F2 type =INDEX(A:A,MATCH (SMALL(C:C,ROW()-1), C:C,0)) Copy down till #NUM! appears.
In G2 type =IF(ISERROR (MATCH($F2&G$1,$D:$D,0)), "",G$1) Copy across till K2.
Select G2 to K2 and copy down to last name in col F.