A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

vlookup - more than one result



 
 
Thread Tools Display Modes
  #1  
Old March 21st 07, 01:25 PM posted to microsoft.public.excel.worksheet.functions
Heine
external usenet poster
 
Posts: 49
Default vlookup - more than one result

Hello everybody,

Does anybody know if it is possible to create a lookup formula, which
returns all values if more than one?

For instance:

1 Tom
1 Dick
1 Harry

Then I want it to return all three names when looking up 1.



Best regards
Heine

Ads
  #2  
Old March 21st 07, 02:40 PM posted to microsoft.public.excel.worksheet.functions
Domenic
external usenet poster
 
Posts: 150
Default vlookup - more than one result

Assuming that A2:A10 contains the number, and B2:B10 contains the
corresponding name, let D2 contain the number of interest, such as 1,
then try...

E2:

=COUNTIF(A2:A10,D2)

F2, copied down:

=IF(ROWS($F$2:F2)<=$E$2,INDEX($B$2:$B$10,SMALL(IF( $A$2:$A$10=$D$2,ROW($A$
2:$A$10)-ROW($A$2)+1),ROWS($F$2:F2))),"")

....confirmed with CONTROL+SHIFT+ENTER, not just ENTER.

Hope this helps!

In article . com>,
"Heine" > wrote:

> Hello everybody,
>
> Does anybody know if it is possible to create a lookup formula, which
> returns all values if more than one?
>
> For instance:
>
> 1 Tom
> 1 Dick
> 1 Harry
>
> Then I want it to return all three names when looking up 1.
>
>
>
> Best regards
> Heine

  #3  
Old March 21st 07, 04:04 PM posted to microsoft.public.excel.worksheet.functions
Heine
external usenet poster
 
Posts: 49
Default vlookup - more than one result

On Mar 21, 3:40 pm, Domenic > wrote:
> Assuming that A2:A10 contains the number, and B2:B10 contains the
> corresponding name, let D2 contain the number of interest, such as 1,
> then try...
>
> E2:
>
> =COUNTIF(A2:A10,D2)
>
> F2, copied down:
>
> =IF(ROWS($F$2:F2)<=$E$2,INDEX($B$2:$B$10,SMALL(IF( $A$2:$A$10=$D$2,ROW($A$
> 2:$A$10)-ROW($A$2)+1),ROWS($F$2:F2))),"")
>
> ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
>
> Hope this helps!
>
> In article . com>,
>
>
>
> "Heine" > wrote:
> > Hello everybody,

>
> > Does anybody know if it is possible to create a lookup formula, which
> > returns all values if more than one?

>
> > For instance:

>
> > 1 Tom
> > 1 Dick
> > 1 Harry

>
> > Then I want it to return all three names when looking up 1.

>
> > Best regards
> > Heine- Hide quoted text -

>
> - Show quoted text -


Thanks a lot - I will try that out

Best regards
Heine

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Show result of a SUM in a VLOOKUP Sarah (OGI) Excel Worksheet Functions 5 March 23rd 07 05:50 PM
Vlookup result change DP7 Excel Worksheet Functions 1 March 6th 07 04:28 PM
vlookup shows result one cell above the expected result Marie Excel Worksheet Functions 7 November 14th 06 02:52 AM
VLOOKUP - Can't see result plunk25 Excel Worksheet Functions 1 June 29th 06 04:58 PM
vlookup based on random result returns incorrect result rickat Excel Worksheet Functions 1 December 6th 05 01:16 PM


All times are GMT +1. The time now is 03:26 PM.


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