Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default lookup function Question

Hi,

I am currently in charge of creating a spreading sheet where certain groups
of zip codes correspond to individual salesmen (e.g. zips 30000-30300 are for
Bob and 30500-30700) are for John. Our database records the 5 digit zip
code, while our territories are broken down into the first 3 digits. How can
I create a lookup function to tell me that zip code 30301 is in Bob's region
and 30507 is in John's territory?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,276
Default lookup function Question

Hi,
Let' say your zip codes are in column B and you want to know who's region
is it in another column enter

=if(and(B1=30000,B1=<30300),"John",if(and(B13030 0,B1<=30500),"Bob"))

"phd4212" wrote:

Hi,

I am currently in charge of creating a spreading sheet where certain groups
of zip codes correspond to individual salesmen (e.g. zips 30000-30300 are for
Bob and 30500-30700) are for John. Our database records the 5 digit zip
code, while our territories are broken down into the first 3 digits. How can
I create a lookup function to tell me that zip code 30301 is in Bob's region
and 30507 is in John's territory?

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
tom tom is offline
external usenet poster
 
Posts: 570
Default lookup function Question



Eduardo's solution works, but it depends on how many salespeople you have.
Another option is to create a table with the zip code a salesperson starts
with in the A column, and the salesperson name in the B column.

Then, a simple V lookup function could determine which salesperson the zip
refers to. This works best with many salespeople.
A B
30000 Mary
30300 Bob
30500 John

=VLOOKUP(30299,A1:B3,2,TRUE)
Here, zip 30299 would result in Mary,
zip 30501 give you John, etc.
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default lookup function Question

Eduardo, thanks for the help but I suppose I oversimplified this query. There
are many more zip codes and they are not as neat as the example--so
30000-30300 might be bobs, but so are 31900,30900,30100,31300 and John has
30500-30700, 31100, 31500 and 32100
That seems like too complicated an if statement, especially if there are
more than 2 salesmen. I'd assume there is an easier way...

"Eduardo" wrote:

Hi,
Let' say your zip codes are in column B and you want to know who's region
is it in another column enter

=if(and(B1=30000,B1=<30300),"John",if(and(B13030 0,B1<=30500),"Bob"))

"phd4212" wrote:

Hi,

I am currently in charge of creating a spreading sheet where certain groups
of zip codes correspond to individual salesmen (e.g. zips 30000-30300 are for
Bob and 30500-30700) are for John. Our database records the 5 digit zip
code, while our territories are broken down into the first 3 digits. How can
I create a lookup function to tell me that zip code 30301 is in Bob's region
and 30507 is in John's territory?

Thanks

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,276
Default lookup function Question

Hi,
ok you have in sheet 2 a list of zip codes in column A and in column B who
is in charge of that area, then in sheet 1 you want to enter in A2 a zip code
and in B2 to see who is in charge, if that is correct use

=INDEX(Sheet2!B10:B13,MATCH(D9,sheet2!A10:A13,0))

change range or sheet name to fit your needs

"phd4212" wrote:

Eduardo, thanks for the help but I suppose I oversimplified this query. There
are many more zip codes and they are not as neat as the example--so
30000-30300 might be bobs, but so are 31900,30900,30100,31300 and John has
30500-30700, 31100, 31500 and 32100
That seems like too complicated an if statement, especially if there are
more than 2 salesmen. I'd assume there is an easier way...

"Eduardo" wrote:

Hi,
Let' say your zip codes are in column B and you want to know who's region
is it in another column enter

=if(and(B1=30000,B1=<30300),"John",if(and(B13030 0,B1<=30500),"Bob"))

"phd4212" wrote:

Hi,

I am currently in charge of creating a spreading sheet where certain groups
of zip codes correspond to individual salesmen (e.g. zips 30000-30300 are for
Bob and 30500-30700) are for John. Our database records the 5 digit zip
code, while our territories are broken down into the first 3 digits. How can
I create a lookup function to tell me that zip code 30301 is in Bob's region
and 30507 is in John's territory?

Thanks



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,276
Default lookup function Question

Hi,
use this formula instead of the one sent before

=INDEX(sheet2!B1:B100,MATCH(B2,sheet2!A1:A100,0))

"phd4212" wrote:

Eduardo, thanks for the help but I suppose I oversimplified this query. There
are many more zip codes and they are not as neat as the example--so
30000-30300 might be bobs, but so are 31900,30900,30100,31300 and John has
30500-30700, 31100, 31500 and 32100
That seems like too complicated an if statement, especially if there are
more than 2 salesmen. I'd assume there is an easier way...

"Eduardo" wrote:

Hi,
Let' say your zip codes are in column B and you want to know who's region
is it in another column enter

=if(and(B1=30000,B1=<30300),"John",if(and(B13030 0,B1<=30500),"Bob"))

"phd4212" wrote:

Hi,

I am currently in charge of creating a spreading sheet where certain groups
of zip codes correspond to individual salesmen (e.g. zips 30000-30300 are for
Bob and 30500-30700) are for John. Our database records the 5 digit zip
code, while our territories are broken down into the first 3 digits. How can
I create a lookup function to tell me that zip code 30301 is in Bob's region
and 30507 is in John's territory?

Thanks

Reply
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
LOOKUP FUNCTION? (LOOKUP VALUE BEING A TIME RENERATED FROM A FORMU JCC Excel Discussion (Misc queries) 5 June 26th 09 09:15 PM
Excel Data Validation/Lookup function does function correcty Kirkey Excel Worksheet Functions 2 May 25th 09 09:22 PM
Question About IF Function and LOOKUP Ryan F Excel Worksheet Functions 6 January 20th 09 04:24 PM
Pivot table doing a lookup without using the lookup function? NGASGELI Excel Discussion (Misc queries) 0 August 2nd 05 05:08 AM
Lookup Question Brad P Excel Worksheet Functions 3 June 5th 05 12:08 AM


All times are GMT +1. The time now is 05:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"