Create duplicate records for entries with year ranges

rebubula

New Member
Joined
Dec 20, 2010
Messages
26
Hi. I am trying to figure out a way to create duplicate records for entries with year ranges. Here is an example of what I am working with:

Input:
Years Make Model Part Number
1997-1999 Dodge Ram 1500 123456

Desired output:
Years Make Model Part Number
1997 Dodge Ram 1500 123456
1998 Dodge Ram 1500 123456
1999 Dodge Ram 1500 123456

Any help is greatly appreciated. Thanks!
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
More than likely, what you will want to do is not have duplicate records like that. I am just going off the sample you provided, but if the only thing that is going to change is the Year, then what you will want is different tables, one with all the info for the parts with PK, Part, Number, where PK is your primary key set to autonumber. Another table for Vehicle, with PK, Year, Make, Model, again PK set to autonumber. A third table would be a Joined table, would contain it's own PK, and the two FK (foreign key's). The FK's are the PK's from your other two tables.

Doing it like this would ensure that you are not duplicating the same info over and over and is good practice.

Here is some more reading: http://office.microsoft.com/en-us/access-help/join-tables-and-queries-HA010096320.aspx

And more: http://www.allenbrowne.com/casu-06.html
 
Upvote 0

Forum statistics

Threads
1,224,582
Messages
6,179,670
Members
452,936
Latest member
anamikabhargaw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top