Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 30
Default Am I on the right path

Hi there,
I have a list of phone numbers by country including number, name and
department and saved them in ranges i.e. a1:b20 = Germany range
a30:b55=France etc

In the second sheet I need to pull in the name and department. I have used
Vlookup which works a treat for one country
=VLOOKUP(P1,'Numbers'!Germany,2,FALSE)

However I wonder how to add if country = france etc then lookup that range
etc for all my countries. Should I use a macro? or IF? or place the
different version of the lookup into each country and copy down?

Thanks, Teddy
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 50
Default Am I on the right path

Hi Teddy ! :) It would be better (easier) to write a macro with .Find instead
of Worksheerfunction.VLOOKUP to do the job.



"Teddy" wrote:

Hi there,
I have a list of phone numbers by country including number, name and
department and saved them in ranges i.e. a1:b20 = Germany range
a30:b55=France etc

In the second sheet I need to pull in the name and department. I have used
Vlookup which works a treat for one country
=VLOOKUP(P1,'Numbers'!Germany,2,FALSE)

However I wonder how to add if country = france etc then lookup that range
etc for all my countries. Should I use a macro? or IF? or place the
different version of the lookup into each country and copy down?

Thanks, Teddy

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 30
Default Am I on the right path

Many thanks for your quick answer. Do you have any suggestions how to do
this or could point me to some sample code? Thanks again.T.

"Vijay Chary" wrote:

Hi Teddy ! :) It would be better (easier) to write a macro with .Find instead
of Worksheerfunction.VLOOKUP to do the job.



"Teddy" wrote:

Hi there,
I have a list of phone numbers by country including number, name and
department and saved them in ranges i.e. a1:b20 = Germany range
a30:b55=France etc

In the second sheet I need to pull in the name and department. I have used
Vlookup which works a treat for one country
=VLOOKUP(P1,'Numbers'!Germany,2,FALSE)

However I wonder how to add if country = france etc then lookup that range
etc for all my countries. Should I use a macro? or IF? or place the
different version of the lookup into each country and copy down?

Thanks, Teddy

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 30
Default Am I on the right path

Don,
Many thanks for your help. Do you mean to first filter by country then
paste in each vlookup changing the named range then copy for that country and
repeat for each country?
Teddy

"Don Guillett" wrote:

If the countries are in a column of their own then select the top row of
your data and use

datafilterautofilterfilter on the column

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Teddy" wrote in message
...
Hi there,
I have a list of phone numbers by country including number, name and
department and saved them in ranges i.e. a1:b20 = Germany range
a30:b55=France etc

In the second sheet I need to pull in the name and department. I have
used
Vlookup which works a treat for one country
=VLOOKUP(P1,'Numbers'!Germany,2,FALSE)

However I wonder how to add if country = france etc then lookup that range
etc for all my countries. Should I use a macro? or IF? or place the
different version of the lookup into each country and copy down?

Thanks, Teddy





  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Am I on the right path

Try it this way:

=VLOOKUP(P1,'Numbers'!A:B,2,FALSE)

That should look up all the numbers in column A, not just those
related to Germany.

Hope this helps.

Pete

On Dec 21, 10:52*am, Teddy wrote:
Hi there,
I have a list of phone numbers by country including number, name and
department and saved them in ranges i.e. a1:b20 = Germany range
a30:b55=France etc *

In the second sheet I need to pull in the name and department. *I have used
Vlookup which works a treat for one country
=VLOOKUP(P1,'Numbers'!Germany,2,FALSE)

However I wonder how to add if country = france etc then lookup that range
etc for all my countries. *Should I use a macro? or IF? or place the
different version of the lookup into each country and copy down?

Thanks, Teddy *


  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 30
Default Am I on the right path

This is great - much more simplified. Didn't realise you could just
reference the columns A:B .
Many thanks,
T

"Pete_UK" wrote:

Try it this way:

=VLOOKUP(P1,'Numbers'!A:B,2,FALSE)

That should look up all the numbers in column A, not just those
related to Germany.

Hope this helps.

Pete

On Dec 21, 10:52 am, Teddy wrote:
Hi there,
I have a list of phone numbers by country including number, name and
department and saved them in ranges i.e. a1:b20 = Germany range
a30:b55=France etc

In the second sheet I need to pull in the name and department. I have used
Vlookup which works a treat for one country
=VLOOKUP(P1,'Numbers'!Germany,2,FALSE)

However I wonder how to add if country = france etc then lookup that range
etc for all my countries. Should I use a macro? or IF? or place the
different version of the lookup into each country and copy down?

Thanks, Teddy



  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Am I on the right path

You're welcome - glad it worked for you.

Pete

On Dec 21, 10:40*pm, Teddy wrote:
This is great - much more simplified. *Didn't realise you could just
reference the columns A:B .
Many thanks,
T



"Pete_UK" wrote:
Try it this way:


=VLOOKUP(P1,'Numbers'!A:B,2,FALSE)


That should look up all the numbers in column A, not just those
related to Germany.


Hope this helps.


Pete


On Dec 21, 10:52 am, Teddy wrote:
Hi there,
I have a list of phone numbers by country including number, name and
department and saved them in ranges i.e. a1:b20 = Germany range
a30:b55=France etc *


In the second sheet I need to pull in the name and department. *I have used
Vlookup which works a treat for one country
=VLOOKUP(P1,'Numbers'!Germany,2,FALSE)


However I wonder how to add if country = france etc then lookup that range
etc for all my countries. *Should I use a macro? or IF? or place the
different version of the lookup into each country and copy down?


Thanks, Teddy *- Hide quoted text -


- Show quoted text -


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
Formula too long - new file path is shorter than old file path - Excel 2003 Greg J Excel Worksheet Functions 1 November 22nd 06 05:16 PM
hyperlink navigation path path wrong in Excel 2003 CE Admin Excel Discussion (Misc queries) 5 January 7th 06 07:47 PM
how to change absolute path to relative path hwijgerse Excel Worksheet Functions 0 November 25th 05 07:18 AM
Workbook path nc Excel Discussion (Misc queries) 2 April 4th 05 03:37 PM
Autosave path Wayne Gore Setting up and Configuration of Excel 2 February 3rd 05 09:57 AM


All times are GMT +1. The time now is 06:43 AM.

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"