Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
JohnnyCai
 
Posts: n/a
Default Formatting a list of data into a row in Excel

I have data exported that requires to be reformatted like so:

x1 a
x1 b
x2 c
x2 d
to become
x1 a b
x2 c d
etc.
Can anyone steer me thru this.
  #2   Report Post  
Posted to microsoft.public.excel.misc
JLatham
 
Posts: n/a
Default Formatting a list of data into a row in Excel

I set up some data like this starting in cell A1:
X1 a
X1 b
X2 c
X2 d
X1 e
X1 f
X1 g
X2 h

Then in E1 I put "X1" and in E2 I put "X2" as the start for the horizontal
format.
In cell F1, right next to E1, I entered this formula:

=IF(OFFSET($A$1,COLUMN(F1)-COLUMN($F1),0)=$E1,OFFSET($A$1,COLUMN(F1)-COLUMN($F1),1),"")

The big thing to notice in that is the cell reference that is the first
parameter to the OFFSET() functions. It must point at the first entry in
your current list that matches the value in E1. You'll have to manually
adjust that in each formula you enter to start a new transition. Here's the
formula I put into F2 (next to "X2" in the new list)

=IF(OFFSET($A$3,COLUMN(F2)-COLUMN($F2),0)=$E2,OFFSET($A$3,COLUMN(F2)-COLUMN($F2),1),"")

Notice that $A$1 had to be changed to $A$3 in both places in the formula for
it to work. I ended up with a table that looks like this (using _ to show
blank cells)

E F G H I J K L
1 X1 a b _ _ e f g
2 X2 c d _ _ _ h _

"JohnnyCai" wrote:

I have data exported that requires to be reformatted like so:

x1 a
x1 b
x2 c
x2 d
to become
x1 a b
x2 c d
etc.
Can anyone steer me thru this.

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
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
Want to Create a List in Excel 2002; Don't see List in Data Menu? Manoj Excel Discussion (Misc queries) 2 April 7th 06 07:34 PM
From several workbooks onto one excel worksheet steve Excel Discussion (Misc queries) 6 December 1st 05 08:03 AM
TRYING TO SET UP EXCEL SPREADSHEET ON MY COMPUTER MEGTOM New Users to Excel 5 October 27th 05 03:06 AM
Excel changing number formatting and source data in graphs on it's own!!! JohnHamer Excel Discussion (Misc queries) 2 September 22nd 05 02:29 PM


All times are GMT +1. The time now is 02:26 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"