Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Convert Columns to row variable data

Hi

I need to convert column data into row data

From this

Name Address
Fred 30 Jones St
London
Sue Tower 42
London
EC2

To this

Name Address1 Address2 Address3
Fred 30 Jones St London
Sue Tower 42 London EC2


I have a macro that can convert but the problem is that
each person address is has a variable amount of fields.
Any way round this

Thanks for any help

David


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 176
Default Convert Columns to row variable data

David,

Assuming your data is in Columns A and B, and starts in Row 2, in cell
C2, use the formula

=IF(AND($A2<"",OFFSET($A2,COLUMN()-2,0)="",B2<""),OFFSET($A2,COLUMN(
)-2,1),"")

Copy as far right as needed, and as far down as your data goes.

Then copy all the formula and pastespecial values, then select column
A and use Edit | Go To... Special.... Blanks OK, and then delete
entire row.

And you're done.

HTH,
Bernie


"David" wrote in message
...
Hi

I need to convert column data into row data

From this

Name Address
Fred 30 Jones St
London
Sue Tower 42
London
EC2

To this

Name Address1 Address2 Address3
Fred 30 Jones St London
Sue Tower 42 London EC2


I have a macro that can convert but the problem is that
each person address is has a variable amount of fields.
Any way round this

Thanks for any help

David




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Convert Columns to row variable data

Thanks that works perfectly !!

david


-----Original Message-----
David,

Assuming your data is in Columns A and B, and starts in

Row 2, in cell
C2, use the formula

=IF(AND($A2<"",OFFSET($A2,COLUMN()-2,0)="",B2<""),OFFSET

($A2,COLUMN(
)-2,1),"")

Copy as far right as needed, and as far down as your data

goes.

Then copy all the formula and pastespecial values, then

select column
A and use Edit | Go To... Special.... Blanks OK, and

then delete
entire row.

And you're done.

HTH,
Bernie


"David" wrote in message
...
Hi

I need to convert column data into row data

From this

Name Address
Fred 30 Jones St
London
Sue Tower 42
London
EC2

To this

Name Address1 Address2 Address3
Fred 30 Jones St London
Sue Tower 42 London EC2


I have a macro that can convert but the problem is that
each person address is has a variable amount of fields.
Any way round this

Thanks for any help

David




.

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
I need to convert a table of data to columns only Pranjali Excel Discussion (Misc queries) 1 February 10th 09 07:08 AM
Convert muliple data into columns Savage Excel Discussion (Misc queries) 8 April 10th 06 05:14 PM
Convert 1 row of data into Multiple columns Mohoney Excel Discussion (Misc queries) 1 August 25th 05 12:36 PM
How do I convert some data in the row to columns? Colin T Excel Discussion (Misc queries) 4 August 17th 05 11:12 PM
Convert data from rows to columns boksic Excel Discussion (Misc queries) 4 July 4th 05 11:40 AM


All times are GMT +1. The time now is 06:33 PM.

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

About Us

"It's about Microsoft Excel"