LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Junior Member
 
Posts: 3
Default Filter ZIP codes into ranges

I am working on a project to take a list of ZIP codes (29,133 rows) and sort it by territory, then find all ZIPs in that territory that are in sequential order and make a ZIP range from the 2 extremes in the sequential group.

The logic behind what I want to do goes like this:

Sort by Region code, then by Zone #, then by ZIP code. Find all groups of ZIP codes sequentially ordered and append the first ZIP in the group to column X and the last ZIP in the group to Column Y.

Regions are made up of territories, territories are mad up of zones. The list should be sorted by zip code in ascending order. All I need it to do is to take all of the zip codes that are in sequential order an put the first one in the sequential group in a cell to the right and the last one in the sequence in the cell to the right of that.

Or the entire sequence can be made in to a range of the extremes in the group.

For example:
Zip Code Zone Region Code Territory Result
07002 0 R6 R6-0 07002
07003 5 R6 R6-5 07003-07004
07004 5 R6 R6-5
07006 0 R6 R6-0 07006-07007
07007 0 R6 R6-0
07009 0 R6 R6-0 07009
07017 0 R6 R6-0 07017-07019
07018 0 R6 R6-0
07019 0 R6 R6-0

The ranges are broken out by zone. I am putting these in a database to track sales. Unless I condense the consecutive zips into ranges I will have 29,000 rules in the database, which will choke my computer. My goal is to cut that down to 14,000 - 15,000 zip code rules. I hope that helps.

Last edited by ronsmail : January 28th 12 at 02:27 AM Reason: better explanation.
 
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
problem with zip codes and filter Joe Excel Discussion (Misc queries) 3 March 18th 08 01:50 PM
Need to convert list of 5 digit zip codes to ranges where possible Mel07 Excel Worksheet Functions 3 March 14th 06 11:43 PM
Date ranges and advanced filter rt Excel Programming 3 December 1st 04 09:12 PM
How to create ranges with auto filter Ivy Chua Excel Programming 1 October 25th 04 06:42 PM
Multiple ranges to Auto Filter Kevin B[_4_] Excel Programming 1 June 30th 04 03:08 AM


All times are GMT +1. The time now is 09:34 PM.

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"