View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default assign value to range

What you describe is called a lookup table. Apparently someone else is
struggling with a similar problem in an earlier thread under the name
rockoffaith. Maybe you should consult with them although they don't seem to
have much more to offer in the form of specifics than you.

Using an if statement would work if you only have 7 different conditions.

=IF(Or(And(B1 1 and B1 < 300), And(B1467,B1<567),And(B1855,B1<964)),
"zone 1",If(or(And(B1=300,B1<400),And(B1=567,B1<=600)) ,"zone2,If( . . .

--
Regards,
Tom Ogilvy



"Justin" wrote:

I have a column with the first three numbers of a zip code. Each of these zip
codes is in a particular zone, but it's not as easy as 00001-00004 = zone 1,
00005-00010 = zone 2...they're all over the place.

I need somehow to have in the zone column a function that says if the number
zip column falls into a particular set of ranges then zone # will = 2-12.

I just don't know how to set up a bunch of ranges. Without knowing how to
do it...my mind would say do something like IF(B1 = {001,300}, {467,567},
{855, 964}), "zone 1" - with the ranges being 001 to 300, 467 to 567, and so
on.

I know that's not the way to do it, of course...but that's what I need to
know.

Thanks so much