You can use the attached file as a template for use with your real data - just copy the data into columns A to H of the Shipping sheet and copy the formula in I2 down to the bottom of your data. Then in the Extract sheet you should copy the formulae in row 2 down as far as it tells you in cell L1. Then you should fix the values of all those formulae, and then you can delete the Shipping sheet (and maybe rename the Extract sheet). Finally, use File | Save As to save the file with a different name.
I2 of the Shipping sheet contains this formula:
which identifies the rows with identical entries in columns C to H, and on the last of those rows (or rows where there is not a duplicate set) it generates a sequential number - the record number.
On the Extract sheet, cell I2 contains this formula:
which identifies the row on the Shipping sheet where those sequential numbers occur.
This formula in B2:
brings the data from column B of the Shipping sheet on the row given by I2. This formula is copied across to H2, and brings the corresponding data from columns C to H in turn. Cell A2 contains a more complex formula, i.e.:
where the part highlighted in red looks to see if the previous row on the Shipping sheet is blank (indicating a block of entries that need to be combined), and if so it gets the data from column A on the first row of the block, i.e. the starting zip code.
There is also a simple formula in L2 which identifies how many records you will end up with on this sheet (and thus how far you need to copy the row of formulae down to). It doesn't matter if you copy too far, but you will see hyphens in column I in this case.
To see the effect on your test data, just copy row 2 down to row 2800. Then you would normally fix the values and then you can delete the Shipping sheet. You can also delete column I.
Hope this helps.
Pete
Bookmarks