Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default Vlookup returning multiple answers

Hi

I have 2 questions:

1. Can I use a vlookup to return all of the results rather than just one at
a time? I need to find all of the staff associated with a particular manager
out of a list.
2. Team sizes can vary so in order to return all of the staff member's names
I need to first manually count how many staff are in the team. Can I use a
formula to return all results for a lookup regardless of the number or do I
need to use a macro to do this?

Cheers
Soph
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default Vlookup returning multiple answers

This can be accomplished using formulas, although a Pivot Table would be the
recommended way to go.

Debra Dalgleish has a web site with an extensive number of pages dedicated
to Pivot tables.

http://www.contextures.com/tiptech.html

Scroll down to the P's, and at the end, there's a page with an intro to
Pivots.

If you still would want a formula, post back with a description of your
datalist configuration.
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"soph" wrote in message
...
Hi

I have 2 questions:

1. Can I use a vlookup to return all of the results rather than just one

at
a time? I need to find all of the staff associated with a particular

manager
out of a list.
2. Team sizes can vary so in order to return all of the staff member's

names
I need to first manually count how many staff are in the team. Can I use

a
formula to return all results for a lookup regardless of the number or do

I
need to use a macro to do this?

Cheers
Soph


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,510
Default Vlookup returning multiple answers

Hi Soph,

Have you considered using AutoFilter. It is simply a magic way of
associating data like you are referring to. When using AutoFilter you can
also use subtotal function to perform a number of mathematical calculations
like count, sum, average etc. on the visible cells.

A tip when using AutoFilter is to leave 3 or 4 blank lines above the column
headers and then click on the first cell below the column headers in column A
and Freeze Panes. The headers and calculations then always remain visible
irrespective of the scrolling on the screen.

If you have not used the above before then look them up in help. They are
quite simple to use but if you have any problems then reply with your
questions and I'll attempt to answer them.

Regards,

OssieMac



"soph" wrote:

Hi

I have 2 questions:

1. Can I use a vlookup to return all of the results rather than just one at
a time? I need to find all of the staff associated with a particular manager
out of a list.
2. Team sizes can vary so in order to return all of the staff member's names
I need to first manually count how many staff are in the team. Can I use a
formula to return all results for a lookup regardless of the number or do I
need to use a macro to do this?

Cheers
Soph

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Vlookup returning multiple answers

Here's a small sample file that demonstrates 2 different formula methods.

Sample file - lookup with multiple lookup values


http://cjoint.com/?ivesCzGGpk

--
Biff
Microsoft Excel MVP


"soph" wrote in message
...
Hi

I have 2 questions:

1. Can I use a vlookup to return all of the results rather than just one
at
a time? I need to find all of the staff associated with a particular
manager
out of a list.
2. Team sizes can vary so in order to return all of the staff member's
names
I need to first manually count how many staff are in the team. Can I use
a
formula to return all results for a lookup regardless of the number or do
I
need to use a macro to do this?

Cheers
Soph



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default Vlookup returning multiple answers

"Ragdyer" wrote...
This can be accomplished using formulas, although a Pivot Table would be
the recommended way to go.

....
"soph" wrote...

....
1. Can I use a vlookup to return all of the results rather than just one
at a time? I need to find all of the staff associated with a particular
manager out of a list.


To me it seems an AutoFilter would be a better idea for this.

2. Team sizes can vary so in order to return all of the staff member's
names I need to first manually count how many staff are in the team.
Can I use a formula to return all results for a lookup regardless of the
number or do I need to use a macro to do this?


One way. If your managers and employees are in a mutliple row, 2-column
range, name the column with managers Mgr and the column with employees Emp.
Then you could create team lists starting in cell D2 using these formulas.

D2:
=T(Mgr)

E2:
=COUNTIF(Mgr,D2)

F2:
=INDEX(Emp,MATCH($D2,Mgr,0))

G2 [array formula]:
=IF(COLUMNS($F2:G2)<=$E2,INDEX(Emp,
SMALL(IF(Mgr=$D2,ROW(Mgr)-MIN(ROW(Mgr))+1),COLUMNS($F2:G2))),"")

Fill G2 right as far as needed. I'll assume that's to column K.

D3 [array formula]:
=INDEX(Mgr,MATCH(0,COUNTIF(D$2:D2,Mgr),0))

Fill E2:K2 down into E3:K3, then fill D3:K3 down as far as needed.




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default Vlookup returning multiple answers

Thanks RD, this was great!

"Ragdyer" wrote:

This can be accomplished using formulas, although a Pivot Table would be the
recommended way to go.

Debra Dalgleish has a web site with an extensive number of pages dedicated
to Pivot tables.

http://www.contextures.com/tiptech.html

Scroll down to the P's, and at the end, there's a page with an intro to
Pivots.

If you still would want a formula, post back with a description of your
datalist configuration.
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"soph" wrote in message
...
Hi

I have 2 questions:

1. Can I use a vlookup to return all of the results rather than just one

at
a time? I need to find all of the staff associated with a particular

manager
out of a list.
2. Team sizes can vary so in order to return all of the staff member's

names
I need to first manually count how many staff are in the team. Can I use

a
formula to return all results for a lookup regardless of the number or do

I
need to use a macro to do this?

Cheers
Soph



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default Vlookup returning multiple answers

Debra deserves the thanks.

Appreciate the feed-back.
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"soph" wrote in message
...
Thanks RD, this was great!

"Ragdyer" wrote:

This can be accomplished using formulas, although a Pivot Table would be
the
recommended way to go.

Debra Dalgleish has a web site with an extensive number of pages
dedicated
to Pivot tables.

http://www.contextures.com/tiptech.html

Scroll down to the P's, and at the end, there's a page with an intro to
Pivots.

If you still would want a formula, post back with a description of your
datalist configuration.
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"soph" wrote in message
...
Hi

I have 2 questions:

1. Can I use a vlookup to return all of the results rather than just
one

at
a time? I need to find all of the staff associated with a particular

manager
out of a list.
2. Team sizes can vary so in order to return all of the staff member's

names
I need to first manually count how many staff are in the team. Can I
use

a
formula to return all results for a lookup regardless of the number or
do

I
need to use a macro to do this?

Cheers
Soph





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
vlookup across multiple files returning #N/A Reebis Excel Discussion (Misc queries) 3 February 14th 07 11:52 PM
How do I only get valid "answers" in a VLOOKUP function (no #N/A's SWEdwards Excel Worksheet Functions 6 October 16th 05 05:46 AM
vlookup returning multiple values soph Excel Worksheet Functions 2 October 14th 05 05:17 AM
VLOOKUP-How do I get answers pulled from different appropriate col rOn Excel Worksheet Functions 2 May 14th 05 02:35 PM
Can VLOOKUP return multiple answers based on several identical lo. jddtct Excel Worksheet Functions 3 January 11th 05 07:03 AM


All times are GMT +1. The time now is 05:17 PM.

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"