Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
netfan
 
Posts: n/a
Default how to re-layout data


hi guys,
here i got a question as below. can anybody kindly help on this? thanks
in adv.
Original layout:
ColumnA ColumnB ColumnC
2006-6-28 9:00 24465
2006-6-28 12:00 25609
2006-6-28 15:00 27295
2006-6-29 9:00 27309
2006-6-29 12:00 27312
2006-6-29 15:00 24465
2006-6-30 9:00 27295
2006-6-30 12:00 27302
2006-6-30 15:00 27309
......
I wanna re-layout it listed in this format:
NewColumnA NewColumnB(9:00) NewColumnC(12:00) NewColumnD(15:00)
2006-6-28 24465(ColumnC1) 25609(ColumnC2) 27295(ColumnC3)

2006-6-29 27309(ColumnC4) 27312(ColumnC5) 24465(ColumnC6)
2006-6-30 27295(ColumnC7) 27302(ColumnC8) 27309(ColumnC9)
......

if there is any method or function to do this automatically?


--
netfan
------------------------------------------------------------------------
netfan's Profile: http://www.excelforum.com/member.php...o&userid=31349
View this thread: http://www.excelforum.com/showthread...hreadid=556167

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
andy62
 
Posts: n/a
Default how to re-layout data

If this is a huge file, or if you need to "relayout" this data on an ongoing
basis, then you could set up a new tab with a bunch of Vlookup functions to
pull in the new data. But assuming you just need to change this once, and
the file is not too big, here's a manual approach that would work:

Fill the new Column A with all the dates. The auto fill works for this (you
establish the first two dates, then highlight those two cells, then grab the
little block on the bottom right corner of the highlighted rectangle, and
drag down) or you could use the Advanced Filter on your existing data to copy
(unique records only) into the new Column A.

Once that is done, go to your existing Column C and copy the first three
cells of data. Now go to your new Column B and click into the cell for that
date, then go to Edit . . . Paste Special. Click the checkbox called
"Transpose" which will switch your "vertical" cells to "horizontal", thus
filling new Columns B, C, and D.

Repeat for all the dates in your old spreadsheet.

Hope that helps, but, again, if this is a huge data set or you have to do
this conversion regularly, then write back for a more permanent solution.

"netfan" wrote:


hi guys,
here i got a question as below. can anybody kindly help on this? thanks
in adv.
Original layout:
ColumnA ColumnB ColumnC
2006-6-28 9:00 24465
2006-6-28 12:00 25609
2006-6-28 15:00 27295
2006-6-29 9:00 27309
2006-6-29 12:00 27312
2006-6-29 15:00 24465
2006-6-30 9:00 27295
2006-6-30 12:00 27302
2006-6-30 15:00 27309
......
I wanna re-layout it listed in this format:
NewColumnA NewColumnB(9:00) NewColumnC(12:00) NewColumnD(15:00)
2006-6-28 24465(ColumnC1) 25609(ColumnC2) 27295(ColumnC3)

2006-6-29 27309(ColumnC4) 27312(ColumnC5) 24465(ColumnC6)
2006-6-30 27295(ColumnC7) 27302(ColumnC8) 27309(ColumnC9)
......

if there is any method or function to do this automatically?


--
netfan
------------------------------------------------------------------------
netfan's Profile: http://www.excelforum.com/member.php...o&userid=31349
View this thread: http://www.excelforum.com/showthread...hreadid=556167


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
netfan
 
Posts: n/a
Default how to re-layout data


Dear andy,
thanks for ur reply. as you imagined, it's a huge file. so i have to
find some way to do with it. any more suggestion pls?


--
netfan
------------------------------------------------------------------------
netfan's Profile: http://www.excelforum.com/member.php...o&userid=31349
View this thread: http://www.excelforum.com/showthread...hreadid=556167

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 158
Default how to re-layout data

Do you ever get an answer to this? You can create a second sheet (sheet2)
which looks up all your data from the first sheet (sheet1), as follows:

First create a second sheet with the following headers in columns A-D:

Date 9:00 12:00 15:00

In column A you'll need to fill in all the dates from your original sheet
(each date needs to appear only once). Should be easy if they are
continuous, or you can use the Advanced Filter to get a list of all unique
values, then paste that list in under the Date header.

Now in cell B2 paste the following formula:

=SUMPRODUCT((Sheet1!$A$1:$A$1000=$A2)*(Sheet1!$B$1 :$B$1000=B$1)*(Sheet1!$C$1:$C$1000))

You'll need to change the sheet references if yours are renamed, and if your
sheet1 has more than 1000 rows then bump up those limits in the formula. But
don't alter the $ signs, they are placed to freeze some of the ranges and
allow others to flex when copied. After customizing your formula in B2, you
can copy it across to C2 and D2, verify that it is working, then copy that
set of three formulas down to all your date rows.

Hope that helps (albeit late).



"netfan" wrote:


Dear andy,
thanks for ur reply. as you imagined, it's a huge file. so i have to
find some way to do with it. any more suggestion pls?


--
netfan
------------------------------------------------------------------------
netfan's Profile: http://www.excelforum.com/member.php...o&userid=31349
View this thread: http://www.excelforum.com/showthread...hreadid=556167


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
Pull data from another sheet based on certain criteria steve_sr2 Excel Discussion (Misc queries) 1 February 23rd 06 10:08 AM
Inserting a new line in spreadsheet Rental Man Excel Discussion (Misc queries) 2 January 9th 06 04:55 PM
Importing Data Jillian Excel Worksheet Functions 9 December 23rd 05 12:45 PM
Saving data in a worksheet within a workbook Homeuser Excel Discussion (Misc queries) 2 August 21st 05 10:49 PM
Line Graph Data Recognition Nat Charts and Charting in Excel 2 April 30th 05 02:07 PM


All times are GMT +1. The time now is 02:10 AM.

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"