Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
wilsonds
 
Posts: n/a
Default Transforming Multiple Rows into 2 columns


I have a range of data in rows that I want to transpose into two columns
in Excel 2000. The first row is the header row that I want to repeat in
the left-hand column. Any ideas how to do this where I can specify
number of original rows to be converted (3 rows or 300 rows) I but can
use the same formula/macro with say a variable adjustment?

I thought about Edit-Paste Special - Transpose – but I need the data
in 2 columns and I need the first row to repeat each time on the left.


An example of what I’m looking to do is below

ORIGINAL
ID FIRST LAST ZIP
1 Bob Smith 63101
2 Jane Doe 63105

NEW TRANSFORMED DATA

ID 1
FIRST Bob
LAST Smith
ZIP 63101
ID 2
FIRST Jane
LAST Doe
ZIP 63105

Thanks in advance,
Darryl


--
wilsonds
------------------------------------------------------------------------
wilsonds's Profile: http://www.excelforum.com/member.php...o&userid=31932
View this thread: http://www.excelforum.com/showthread...hreadid=516579

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove
 
Posts: n/a
Default Transforming Multiple Rows into 2 columns

wilsonds wrote...
....
An example of what I'm looking to do is below

ORIGINAL
ID FIRST LAST ZIP
1 Bob Smith 63101
2 Jane Doe 63105

NEW TRANSFORMED DATA

ID 1
FIRST Bob
LAST Smith
ZIP 63101
ID 2
FIRST Jane
LAST Doe
ZIP 63105


Uncrosstabbing. The general approach uses INDEX, INT, MOD, COLUMNS and
ROWS functions. For my conventience, I'll assume your original data
range is named D and the top-left cell of the result range is G1.

G1:
=INDEX(D,1,1+MOD(ROWS(G$1:G1)-1,COLUMNS(D)))

H1:
=INDEX(D,2+INT((ROWS(H$1:H1)-1)/COLUMNS(D)),
1+MOD(ROWS(H$1:H1)-1,COLUMNS(D)))

Select G1:H1 and fill down as far as needed.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
wilsonds
 
Posts: n/a
Default Transforming Multiple Rows into 2 columns


This worked!! - Great! one follow-up question...
I want to create a third column (it's the key for the transformed row
for import to Access table – forgot this in original request) that is
based upon column A value for each row - So I want to create a third
column (first of the three) that has a static value in a column for all
entries of the uncrosstabbed row - value comes from ID column in each
row. The static value for column is added to the sample data below.

ORIGINAL DATA - REVISED

ID FIRST LAST ZIP
1 Bob Smith 63101
2 Jane Doe 63105

TRANSFORMED DATA WITH THIRD COLUMN – STATIC DATA

1 ID 1
1 FIRST Bob
1 LAST Smith
1 ZIP 63101
2 ID 2
2 FIRST Jane
2 LAST Doe
2 ZIP 63105

Thank you,
Darryl


--
wilsonds
------------------------------------------------------------------------
wilsonds's Profile: http://www.excelforum.com/member.php...o&userid=31932
View this thread: http://www.excelforum.com/showthread...hreadid=516579

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove
 
Posts: n/a
Default Transforming Multiple Rows into 2 columns

"wilsonds" wrote...
....
I want to create a third column (it's the key for the transformed row
for import to Access table – forgot this in original request) that is
based upon column A value for each row - So I want to create a third
column (first of the three) that has a static value in a column for all
entries of the uncrosstabbed row - value comes from ID column in each
row. The static value for column is added to the sample data below.

ORIGINAL DATA - REVISED

ID FIRST LAST ZIP
1 Bob Smith 63101
2 Jane Doe 63105

TRANSFORMED DATA WITH THIRD COLUMN – STATIC DATA

1 ID 1
1 FIRST Bob
1 LAST Smith
1 ZIP 63101
2 ID 2
2 FIRST Jane
2 LAST Doe
2 ZIP 63105


Same assumptions/setup as before.

G1:
=1+INT((ROWS(G$1:G1)-1)/COLUMNS(D))

H1:
=INDEX(D,1,1+MOD(ROWS(H$1:H1)-1,COLUMNS(D)))

I1:
=INDEX(D,G1+1,1+MOD(ROWS(I$1:I1)-1,COLUMNS(D)))

Select G1:H1 and fill down.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
using functions to compare multiple columns for mismatch of cells MDIAZ451 Excel Worksheet Functions 3 February 13th 06 02:49 AM
Change a Column list into multiple rows & columns angelface Excel Worksheet Functions 3 January 28th 06 01:23 AM
Move multiple rows of data that are not sequential Mel Excel Discussion (Misc queries) 1 January 20th 06 06:33 AM
Hiding of rows and columns srinivasan Excel Discussion (Misc queries) 1 July 21st 05 08:59 AM
averaging specific rows in multiple arrays GJR3599 Excel Worksheet Functions 2 March 3rd 05 12:24 PM


All times are GMT +1. The time now is 03:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"