Case ( ZipCode < 19999 ; 1 ;
Zipcode < 29999 ; 2 ;
ZipCode < 39999 ; 3 ;
ZipCode < 49999 ; 4 ;
and so forth....
is one possibility. Here's another:
Max ( Div ( ZipCode ; 10000 ) ; 1 )
What if the case is between two values
ie: If zip code is between 00001 < Zip Code < 12999 and 14000 < zip code < 15999 then result is zone 1
and zip code is between 13000 < Zip Code < 13999 then result is zone 2. Your help is greatly appreciate it
Both calculations still work.
This works in the Case function because case starts with the first Boolean expression, ZipCode < 19999, evaluates it and then only tries the next Boolean expression if the previous one does not evaluate as True. Thus, it never checks to see if the value is less than 29999 until the previous test confirms that it is not less than 19999. Thus 2 will be returned for all values from 20000 to 29999.