Transpose Multiple Columns Into Rows Based On Repeats
Jul 9, 2009
I need to transpose a three column worksheet with thousands of rows containing repeats based on the value in Column A (between 2 and 11 consecutive repeats), into rows with no repeats, and the values from the repeated rows into new columns. Column A has a unique numeric value corresponding to the repeated rows. Column B has 1 of 11 values and Column C has 1 of 4 values.
The worksheet looks like this:
1 abc x
1 def y
2 ghi x
2 abc n
2 lmn x
2 def z
2 jkl y
I need to make it look like this:
1 abc x def y
2 ghi x abc n lmn x def z jkl y
I tried using the following code, but it dropped all the values from column C:
Sub kTest()
Dim a, i As Long, w(), k(), n As Long
Dim dic As Object, ws As Worksheet, s As String
Set dic = CreateObject("scripting.dictionary")
dic.comparemode = vbTextCompare
With Sheets("sheet1")
a = . Range("a2:b" & .Range("a" & Rows.Count).End(xlUp).Row)
End With
I am attaching a workbook " Book 1" that has the results from the above macro in the first worksheet "Final Report", the origninal data "orig data", and the format I need to get the data into "needed data".
View 5 Replies
ADVERTISEMENT
Sep 26, 2008
I am stumped on how to transpose multiple columns to rows based on specific criteria. Here is an example of the data I am working with:
Acct #Rev CodeUnitsCharges10094537034503$0.0010094537034501$605.0010094537037101$0.0010096359034503$0.0010096359034501$355.0010096359037101$0.00
I want it to look like the following:
Acct #Rev CodeUnitsChargesRev CodeUnitsChargesRev CodeUnitsCharges10094537034503$0.004501$605.007101$0.0010096359034503$0.004501$355.007101$0.00
I should note that there is oftentimes more than three rows for the same account number, sometimes it could be as many as 20 rows for the same account.
View 11 Replies
View Related
Jul 10, 2008
I have two columns of data as follows:
10:57:42 273
10:57:42 263
10:57:42 253
10:57:42 241
10:57:37 273
10:57:37 243
10:57:37 249
10:57:37 261
10:57:37 253
11:04:47 241
11:04:47 253
11:04:47 263
10:54:31 254
10:54:31 240
10:54:31 265.......
View 9 Replies
View Related
Nov 20, 2013
I have following information. I need to transpose the columns into rows
C
10001
V
1000
V
1001
V
1002
C
10002
V
1001
V
1003
C
10003
V
1001
V
1003
V
1004
The expected result should be like
10001 1000 1001 1002
10002 1001 1003
10003 1001 1003 1004
View 4 Replies
View Related
Jul 9, 2007
I have a set of data which in one column, includes 500 countries, each followed by a list of 43 entries. I want to transpose the data into rows, so that the countries are all in one column, and the 43 entries are in rows as well..
View 7 Replies
View Related
Jul 21, 2013
How to selectively transpose a row of dates to columns. I'm not sure exactly how to explain this, so below is an example of what the data look like entered into the spreadsheet:
study ID
provider
visit 1
visit 2
visit 3
visit 4
visit 5
[Code]....
I'd like to extract the data into a new table on another worksheet that looks like this:
Date
provider
study id
visit #
7/21/13
Test Name
10001
[Code]...
This is just a quick example, but basically it would continue through all possible visit dates for the first study ID, then move to the next row of data (i.e. the next study ID) and extract the data from the row and transpose it in the appropriate columns moving down...
View 14 Replies
View Related
Mar 9, 2009
How to convert multiple Rows recors to a single row record in a Notes(csv) format? Have update my xls file. My source is in the below format(Source.xls):
GroupName_A,Name_A
GroupName_A,Name_B
GroupName_A,Name_C
GroupName_B,Name_D
GroupName_B,Name_E
GroupName_B,Name_F
GroupName_B,Name_G
GroupName_B,Name_H
GroupName_B,Name_I
I want to convert it to a CSV file where by it can be import to Lotus Notes (output.xls):
1,1,Group,GroupName_A,"Name_A,Name_B,Name_C","CN=John Sam/OU=FIN/OU=staff/O=IBM,CN=Mary Flow/OU=FIN/OU=staff/O=IBM",CN=John Sam/OU=FIN/OU=staff/O=IBM
1,1,Group,GroupName_B,"Name_D,Name_E,Name_F,Name_G,Name_H,Name_I","CN=John Sam/OU=FIN/OU=staff/O=IBM,CN=Mary Flow/OU=FIN/OU=staff/O=IBM",CN=John Sam/OU=FIN/OU=staff/O=IBM
As you can see only GroupNameN, and Name_N are varibles, the rest of the fields are static. note that there is opening and closing quota for column "E" and "F" in output.xls
View 5 Replies
View Related
Mar 19, 2009
I have a sheet with 3,000 rows and only two columns. Column "A" consists of 20 to 30 different names, column "B" consists of 50 to 60 different products. I need to be able to evalute the value in column A and copy, paste special transpose all values in Column B that have the same value in column A. As an example if cells A1 through A5 is "Arizona" and cell B1 is Broccoli, B2 is Cauliflower, B3 is Apples, B4 is Oranges, and B5 is Bananas, I want to copy B1 through B5 and paste special transpose to cell C1.
This then would need to loop all the way to the bottom of the data in Column A looking for a change in value. The attached file called Sample Data has two tabs. The one titled "report" shows the raw data, the one titled "Final" shows how I would like the results to appear (column L)
View 6 Replies
View Related
Jul 1, 2008
i have a unique transposing situation and i need a script to transpose my data. i haven't encountered anything like this yet so i wonder if its possible
my data is currently in this format:
Object1, Property1, Value
Object1, Property2, Value
Object2, Property1, Value
Object2, Property2, Value
i'd like to transpose it to:
........... Property1 Property2
Object1 Value Value
Object2 Value Value
View 9 Replies
View Related
Jul 28, 2013
i need to mark some row (which has some content written in), mark other row(with data too) and switch/transpose them mutual. when i was trying transpose method, which is using for switching rowns and columns, it wrote me error, that data are overlapping. it means it cant work on same things (rows > rows, columns > columns).
View 14 Replies
View Related
Jun 10, 2014
A code to transpose from rows to columns.
But why doesn't it transpose like the sheet 'How it should be' but all in one row?
HTML Code:
Sub MG10Jun34()
Dim Rng As Range
Dim Dn As Range
Dim c As Long
Application.ScreenUpdating = False
[Code] .......
View 2 Replies
View Related
Sep 26, 2013
I have 19 rows of data spanning 184 columns, and I'm attempting to transpose them to be 19 columns and 184 rows, which would normally be easy. The problem is I need to be able to transpose the numbers while still keeping the formulas on a separate worksheet linking/connecting to the correct cells. I almost need to be able to cut/special paste - transpose, but that's not possible... I don't think.
View 3 Replies
View Related
Nov 5, 2011
I have some sales history data for products which I need in one row. Each product has 4 rows x 12 columns (months) of data under each other. I need the 48 months of data in one row per product. A sample of the type of data I have is below (product A) along with the expected result. In the real data there would be many products not just one as per my example.
Sheet1 *ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAW1
Sample Data
[Code] .......
View 6 Replies
View Related
May 17, 2013
how transpose my 4 Colunas to 1 Row
Before:
Data1
Data2
Data3
Data4
[Code]...
View 7 Replies
View Related
Dec 18, 2007
how do i transpose from rows to columns
i have 545 names with addresses
Sheet1 GH221name23 adress line124 adress line225 phone26 fax272name28 adress line129 adress line230 phone31 fax323name33 adress line134 adress line235 phone36 fax37 city384name39 fax40 city Excel tables to the web >> Excel Jeanie HTML 4
selecting each block of name+address is tedious --how can i do it in one go
also the number of rows varies in each block -- at places there are 4 rows at other places 3 rows and so on
View 9 Replies
View Related
Oct 3, 2006
I have some summary results stated in row format by GL at the row header. I would like the GL to be the column header and the unit to be the row header. I tried using the index function but keep receiving #VALUE! error. Sample attached.
View 3 Replies
View Related
Nov 17, 2006
refer to the attached file. I have series of continuous data which is numbered from 1 to 100. They are arranged in vertical order. Due to some application, i need to convert them into another sheet so that they can be viewed horizontally. I used HLOOKUP to obtain the data from sheet 1. Now i have only 17 groups of data and i still have 83 more data to be input in the future. Is there any VBA code that can help me "extend" the equation in sheet2 so that whenever i key in the data in sheet1, the corresponding data will be generated automatically in sheet2?
View 3 Replies
View Related
Jun 25, 2007
transposing columns and rows in an Excel worksheet. This data is a table of part numbers requested vs. received over several different days. Currently, the data is sorted by date across the columns, and each date is split into two columns for requested and received. The rows are labeled with the individual part numbers.
I would like to format the data so that the part numbers appear as the column label, and each part number label is split into two columns for requested and received. Also, the date would then signify the date of each value in the table. I have attempted to use the transpose command, but this only gets me half-way there - still struggling with the splitting of the columns. I can drag a simple "= CELL" command, but the existing data is too cumbersome to build this. I thought a macro might be more efficient.
The file attached is a snap-shot of the data, but will display the formatting challenge I have. The worksheet "Given Format" is the current, while the "Desired Format" is the desired.
View 4 Replies
View Related
Aug 8, 2007
I want to transpose the phone number and website over where the name is? I know I can do a copy and paste special and transpose but then I have do it individuallly and I have over thousands rows.I have attached an example.
View 3 Replies
View Related
Nov 19, 2008
I am trying to clean up some data, which is organized horizantally AND in rows, as per the attached screenshot.
The fact that there is data horizontally across seven week days and in rows for the weeks of the year makes it impossible for me to use the simple TRANSPOSE feature, of which I am aware...
I have quite a couple of worksheets I need to apply this operation on, so manual work is the worst solution...
View 13 Replies
View Related
Mar 26, 2009
I have an excel spreadsheet which contains data for customers and the last date they were seen at an appointment (along with various other bits of info).
The way the data is exported from my database package means that each customer has one row per appointment, i.e. row 1 contains john smith, 01/01/2009, row 2 contains john smith, 03/03/2009, row 3 contains john smith 01/04/2009, row 4 contains joe bloggs 12/02/2009, row 5 contains joe bloggs 27/03/2009. Some customers may have 4 or 5 appointments listed whereas another customer may only have one. I need to get the appointments all onto one row per customer so that I can calculate the number of days between appointments. I have tried to use transpose, but with 8000 rows it takes forever.
View 4 Replies
View Related
Jun 23, 2014
I am having months JAN TO DEC In sheet 1 in columns A1,B1,C1, and so on
I want to transpose them to Rows in sheet 2 , how do i this using transpose function in vba code.
View 3 Replies
View Related
Mar 19, 2009
I have Excel 2007 and a two column lexicon in the following format:
word1 ; word_a
word1 ; word_b
word2 ; word_c
word2 ; word_d
word2 ; word_e
word3 ; word_f
would it somehow be possible to transpose it to:
word1 ; word_a ; word_b
word2 ; word_c ; word_d ; word_e
word3 ; word_f
View 3 Replies
View Related
Aug 16, 2008
We have to copy from lot of Java webpages
1. Data of single column 3 rows of data to First blank cell in 'C' column (say C6)
2. Then Transpose it across to the same row into 3 columns (from same C6 to d6 & e6)
Here I tried some VBA but needs how to put it across....
View 4 Replies
View Related
Feb 22, 2008
This is a snippit of my table1000 employees)
Benefit Emp1#Emp2#Emp3# ... ...
Earnings Pay34885.3541553.5825012.36
Health Insurance4317.0304317.03
[Code].....
View 6 Replies
View Related
Feb 22, 2008
This is a snippit of my table1000 employees) ...
View 4 Replies
View Related
Feb 13, 2014
I am struggling with an Excel Database, to make it "cleaner". Here is my problem. My database looks something like that:
Column A Column B Column C ... Column H
ID Age Date of Birth ... Language
00001 14 01/01/2000 ... English
00001 14 01/01/2000 ... French
00002 14 01/01/2000 ... English
00003 14 01/01/2000 ... French
00003 14 01/01/2000 ... German
00001 14 01/01/2000 ... Spanish
Basically, Columns B & C will never change for the same ID, but columns G, H and others contain data that is different from one row to the other. What i wwould like to do is having unique values in Rows, with Languages displayed in Columns. The database would look like this:
Column A Column B Column C ... Column H Column I Column J
ID Age Date of Birth ... Language 1 Language 2 Language 3
00001 14 01/01/2000 ... English French Spanish
00002 14 01/01/2000 ... English
00003 14 01/01/2000 ... French German
The challenge is that I would need this to be done with formulas only, not using any kind of code. Deleting duplicates manually after "cleaning" the database should'nt be a problem. I tried a formula found on this forum, but i couldn't manage to make it work. The formula looked like this:
{=IFERROR(INDEX($C$4:$C$8;SMALL(IF(FREQUENCY(MATCH($C$4:$C$8;$C$4:$C$8;0);MATCH($C$4:$C$8;$C$4:$C$8;0));ROW($C$4:$C$8)-ROW($C$4)+1);ROWS(C$16:C17)));"")}
View 2 Replies
View Related
May 18, 2013
So, I have a column with data on rows as follows below. I need to arrange the data below in such a way that I have on first column the company name, second column the contact person and so on depending on what data is found (tel, e-mail, website).
The data is on rows and I have separated each company/group of data with a row between them. There are in total aprox 200 companies/groups of data that I need to arrange as explained above.
I have tried with transpose but I have to manually do it 200 times. I have tried with an indirect formula but the companies/groups of data do no have same amount of info/rows e.g. some lack the phone number or other data.
if there is a method to save the time and not arrange them manually.
Actinote
Contact: Toine Kets
Managing Director
Str. Tache Ionescu 3, Et. 5, Apt. 10
[Code]....
View 7 Replies
View Related
Apr 23, 2014
I have a huge file with names, addresses and account types & numbers. However, there's a separate row for each account type instead of listing the person's name once and indicating all of their account types on that row as well in separate columns. I've seen several post regarding different Macro codes to use; however, none work for my project since I have several columns that need to be compared beginning on A2:K2 to A24628:K24628. I have attached a small example for your review.
Transpose Needed.xlsx
View 2 Replies
View Related
Nov 2, 2007
I have problems to write a macro to rearrange the table from attachment file sheet1 to sheet2. I have many files that need to transpose rows to columns and with continually years, month, day, and the rest parameters. some to the files many content more then 20 years data.
View 5 Replies
View Related