Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macro help to rearrange excel table

I sure hope one of you macro gurus can help me...

I have a 3 column list that gets imported from an ascii file that I need to
manipulate. Here's a source sample:


NAME RM# Date
BOB SMITH 204 28-Jan-06
BOB SMITH 204 28-Feb-06
BOB SMITH 204 14-Mar-06
BOB SMITH 204 10-Apr-06
ALLAN JONES 202 28-Jan-06
ALLAN JONES 202 28-Feb-06
ALLAN JONES 202 14-Mar-06
ALLAN JONES 202 10-Apr-06
ISABEL PERKINS 205 28-Jan-06
ISABEL PERKINS 205 28-Feb-06
ISABEL PERKINS 205 9-Mar-06
ISABEL PERKINS 205 14-Mar-06
ISABEL PERKINS 205 10-Apr-06


What I need to do is rearrange this data so that there is 1 row per unique
name and create columns for the dates in the order they appear in the list.
Having it done on another worksheet would suffice.

Headers would be:

NAME, RM#, Date1, Date2, Date3, Date4, Date5.....

Using the sample above it would look like:

NAME RM# DATE1 DATE2 DATE3 DATE4
BOB SMITH 204 28-Jan-06 28-Feb-06 14-Mar-06 10-Apr-06
ALLAN JONES 202 28-Jan-06 28-Feb-06 14-Mar-06 10-Apr-06


There may be more dates for some people, so a check for the name change
should drive the rearrangement.

Is anyone up for the challenge??

TIA, Alan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 477
Default Macro help to rearrange excel table

With your first data record info in A4:C4, in
D4:H4 enter:
=COUNTIF($A$4:$A4,A4) =IF(D4=1,C4,"")
=IF($D5=2,OFFSET($D5,0,-1),"") =IF($D6=3,OFFSET($D6,0,-1),"")
=IF($D7=4,OFFSET($D7,0,-1),"")
Copy down All 5 formulas as far down as is needed.
Hide Columns C:D
This is One way...
Above only allows for 4 dates - you can create more based on the examples
given..

HTH
Jim May

"Alan" wrote:

I sure hope one of you macro gurus can help me...

I have a 3 column list that gets imported from an ascii file that I need to
manipulate. Here's a source sample:


NAME RM# Date
BOB SMITH 204 28-Jan-06
BOB SMITH 204 28-Feb-06
BOB SMITH 204 14-Mar-06
BOB SMITH 204 10-Apr-06
ALLAN JONES 202 28-Jan-06
ALLAN JONES 202 28-Feb-06
ALLAN JONES 202 14-Mar-06
ALLAN JONES 202 10-Apr-06
ISABEL PERKINS 205 28-Jan-06
ISABEL PERKINS 205 28-Feb-06
ISABEL PERKINS 205 9-Mar-06
ISABEL PERKINS 205 14-Mar-06
ISABEL PERKINS 205 10-Apr-06


What I need to do is rearrange this data so that there is 1 row per unique
name and create columns for the dates in the order they appear in the list.
Having it done on another worksheet would suffice.

Headers would be:

NAME, RM#, Date1, Date2, Date3, Date4, Date5.....

Using the sample above it would look like:

NAME RM# DATE1 DATE2 DATE3 DATE4
BOB SMITH 204 28-Jan-06 28-Feb-06 14-Mar-06 10-Apr-06
ALLAN JONES 202 28-Jan-06 28-Feb-06 14-Mar-06 10-Apr-06


There may be more dates for some people, so a check for the name change
should drive the rearrangement.

Is anyone up for the challenge??

TIA, Alan

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
rearrange the data with a new table KS Excel Worksheet Functions 6 February 18th 09 02:16 PM
need to take data from one table and rearrange columns into new ta need-some-help! Excel Discussion (Misc queries) 1 February 12th 09 02:19 AM
EXcel 2002: How to rearrange data table ? Mr. Low Excel Discussion (Misc queries) 0 February 20th 08 01:58 PM
How do i rearrange pie chart without re-arranging source table? Taso Charts and Charting in Excel 1 November 9th 05 08:59 PM
Rearrange data columns in Pivot Table hedrew3 Excel Discussion (Misc queries) 5 February 5th 05 07:44 AM


All times are GMT +1. The time now is 07:21 AM.

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"