Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 93
Default Create new records from existing ones based on 'rule'?

I am trying to pull apart records I uploaded that are set up something like
this;

MainField | Other Fields | AssociatedFIeld1 | AssociatedFieldN

There can be anywhere from zero to 6 Associated Fields. Trying to break a
new record apart for each e.g.

MainRecordX | Other Fields | WidgetA | WidgetB
MainRecordY | Other FIelds |WidgetC | Widget D | WidgetE
MainRecordZ | Other FIelds

should become

MainRecordX | Other Fields | WidgetA
MainRecordX | Other Fields | WidgetB
MainRecordY | Other Fields | WidgetC
MainRecordY | Other Fields | WidgetD
MainRecordY | Other Fields | WidgetE
MainRecordZ | Other Fields

Any insights appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 193
Default Create new records from existing ones based on 'rule'?

Say your data is in Sheet1!A2:J50, with headers in A1:J1.

Columns B to D (for this example) contain your Other Fields, and E to J your
Associated Fields.

In Sheet2!A2:

=Sheet1!A2

copied along B2:E2.


In Sheet2!A3:

=IF(COUNTA(OFFSET(Sheet1!$E$2:$J$50,
MATCH(A2,Sheet1!$A$2:$A$50,0)-1,,1))
COUNTIF(A$2:A2,A2),A2,INDEX(Sheet1!$A$2:$A$50,
MATCH(A2,Sheet1!$A$2:$A$50,0)+1))

In Sheet2!B3:

=INDEX(Sheet1!B$2:B$50,MATCH($A3,Sheet1!$A$2:$A$50 ,0))

copied along C3:D3.

In Sheet2!E3:

=INDEX(Sheet1!$E$2:$J$50,
MATCH($A3,Sheet1!$A$2:$A$50,0),
IF($A3=$A2,MATCH(E2,OFFSET(Sheet1!$E$2:$J$50,
MATCH($A3,Sheet1!$A$2:$A$50,0)-1,,1),0))+1)


Now copy A3:E3 down as far as required.

HTH
Steve D.


"msnyc07" wrote in message
...
I am trying to pull apart records I uploaded that are set up something like
this;

MainField | Other Fields | AssociatedFIeld1 | AssociatedFieldN

There can be anywhere from zero to 6 Associated Fields. Trying to break a
new record apart for each e.g.

MainRecordX | Other Fields | WidgetA | WidgetB
MainRecordY | Other FIelds |WidgetC | Widget D | WidgetE
MainRecordZ | Other FIelds

should become

MainRecordX | Other Fields | WidgetA
MainRecordX | Other Fields | WidgetB
MainRecordY | Other Fields | WidgetC
MainRecordY | Other Fields | WidgetD
MainRecordY | Other Fields | WidgetE
MainRecordZ | Other Fields

Any insights appreciated.


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
Create a rule Maggie Boby Excel Worksheet Functions 0 January 20th 08 07:10 PM
how do i use sturge's rule to create frequency table? natts Excel Discussion (Misc queries) 1 November 14th 06 05:39 AM
How to add text to all existing records in one column? usmleboy Excel Discussion (Misc queries) 4 January 6th 06 09:01 PM
Dynamically create worksheets in Excel based off existing data? tlozier Excel Discussion (Misc queries) 1 September 10th 05 12:25 AM
Insert without disturbing existing records Nipun Excel Discussion (Misc queries) 2 February 23rd 05 06:47 AM


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