WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

How to look up a value in a list and return multiple corre..

 
   Home -> Office -> General Discussions RSS
Next:  Outlook Contacts  
Author Message
user

External


Since: Nov 18, 2009
Posts: 1



(Msg. 1) Posted: Wed Nov 18, 2009 5:02 pm
Post subject: How to look up a value in a list and return multiple corresponding
Archived from groups: microsoft>public>excel>misc (more info?)

I followed the instructions on the excel help page of how look up a value in
a list and return multiple corresponding values but somethings not right. I
have tried this numerous times in my excel spreadsheet and it does not return
any values let alone numerous values. No values will appear unless I go into
the insert menu and click function, but then here it will only give me the
smallest value, even when there is more than one. Please help asap! Thank
you.
Back to top
Login to vote
Pete_UK

External


Since: Apr 17, 2007
Posts: 3897



(Msg. 2) Posted: Wed Nov 18, 2009 5:33 pm
Post subject: Re: How to look up a value in a list and return multiple [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

That's how VLOOKUP (and MATCH, HLOOKUP etc) works when you have
multiple matching values - it returns the first matching value in the
list.

There are ways around it. I like to set up in another column a unique
reference, made up from the value in the first column of your table
together with a sequential number (an occurrence number, if you like).
You can then use this as the lookup column, although you might have to
use INDEX/MATCH rather than VLOOKUP as the new unique reference may
not be in the left-most column of your table (which is where it needs
to be for VLOOKUP to work). Consider an example with a table like
this:

abc 12
abc 15
def 21
abc 19
xyz 13
def 25
abc 17

Put this formula in C1 and copy down:

=IF(A1="","",A1&"_"&COUNTIF(A$1:A1,A1))

which will result in the following in column C:

abc_1
abc_2
def_1
abc_3
xzy_1
def_2
abc_4

The underscore is not strictly needed, but you can see how a
sequential number has been added onto the values from column A, which
gives us our unique references. Now, suppose in E1 you enter the value
that you want to lookup, eg abc, and you want to return all the
corresponding values in column F. Put this in F1:

=IF(E$1="","",IF(ISNA(MATCH(E$1&"_"&ROW(A1),C:C,0)),"",INDEX(B:B,MATCH
(E$1&"_"&ROW(A1),C:C,0))))

and copy it down as far as you think you might need it (eg to F7),
with this result:

12
15
19
17

and 3 blank cells beyond it as there are no more repeats of abc.
Change E1 to def and see the numbers change accordingly.

Obviously, your own situation will be much bigger than this example,
but as you gave no details of what cells you currently use I can only
refer to the example layout - perhaps you can apply the formula to
your own data.

Hope this helps.

Pete


On Nov 19, 1:02 am, 123456789 <123456... DeleteThis @discussions.microsoft.com>
wrote:
> I followed the instructions on the excel help page of how look up a value in
> a list and return multiple corresponding values but somethings not right. I
> have tried this numerous times in my excel spreadsheet and it does not return
> any values let alone numerous values.  No values will appear unless I go into
> the insert menu and click function, but then here it will only give me the
> smallest value, even when there is more than one.  Please help asap! Thank
> you.
Back to top
Login to vote
T. Valko

External


Since: Nov 24, 2006
Posts: 6927



(Msg. 3) Posted: Wed Nov 18, 2009 8:38 pm
Post subject: Re: How to look up a value in a list and return multiple corresponding [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

How about giving us some details?

--
Biff
Microsoft Excel MVP


"123456789" <123456789.TakeThisOut@discussions.microsoft.com> wrote in message
news:87EB96E3-434E-4616-8DB0-0C926AE5E4E8@microsoft.com...
>I followed the instructions on the excel help page of how look up a value
>in
> a list and return multiple corresponding values but somethings not right.
> I
> have tried this numerous times in my excel spreadsheet and it does not
> return
> any values let alone numerous values. No values will appear unless I go
> into
> the insert menu and click function, but then here it will only give me the
> smallest value, even when there is more than one. Please help asap! Thank
> you.
Back to top
Login to vote
Display posts from previous:   
       Home -> Office -> General Discussions All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
  Office
 Office Other
 Security
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET |
  • IT Support