Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Jen Jen is offline
external usenet poster
 
Posts: 119
Default vlookups with multiple answers


Is it possible to do a formula within a VLOOKUP when the return answer could
be more than one thing.
I.e., if I have a list of property numbers but there are several lease
numbers for each one. I only want to pull back property 123 is it has lease 4
as well. It may have lease 1, 2, 3. Normally with a vlookup it brings back
only the first answer whereas I need to lookup the answer too.
If that makes sense...
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,440
Default vlookups with multiple answers

Not sure what you mean, but do look he

http://office.microsoft.com/en-us/as...260381033.aspx


--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Jen" wrote in message ...
|
| Is it possible to do a formula within a VLOOKUP when the return answer could
| be more than one thing.
| I.e., if I have a list of property numbers but there are several lease
| numbers for each one. I only want to pull back property 123 is it has lease 4
| as well. It may have lease 1, 2, 3. Normally with a vlookup it brings back
| only the first answer whereas I need to lookup the answer too.
| If that makes sense...


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default vlookups with multiple answers

I don't believe you can do it with Vlookup but you can do it with Index. The
formula below has the following arguments:-

A2:B500. the lookup array
J1 = what to look for
K1 the instance to look for 1 for first or 2 for 2nd etc
It returns the value from the second column (The last 2 in the formula.
It's an array so Ctrl+shift+enter


=INDEX($A$2:$B500,SMALL(IF($A$2:$B500=$J$1,ROW($A$ 2:$B500)-ROW($A$2)+1,ROW($B500)+1),K1),2)

Mike

"Jen" wrote:


Is it possible to do a formula within a VLOOKUP when the return answer could
be more than one thing.
I.e., if I have a list of property numbers but there are several lease
numbers for each one. I only want to pull back property 123 is it has lease 4
as well. It may have lease 1, 2, 3. Normally with a vlookup it brings back
only the first answer whereas I need to lookup the answer too.
If that makes sense...

  #4   Report Post  
Posted to microsoft.public.excel.misc
Jen Jen is offline
external usenet poster
 
Posts: 119
Default vlookups with multiple answers

I've tried this and it's coming up #NUM! I can see the logic in the formula
but can't see where I'm going wrong. Here is my formula-
=INDEX(A1:B7,SMALL(IF(A1:B7=B1,ROW(A1:B7)-ROW(A1)+1,ROW(B7)+1),K1),2)

And ideas?
My array is:
Ashish 234
Sanjay 334
Pongal 434
Ashish 534
Rajesh 634
Suresh 734
Ashish 834


You cannot imagine how much easier this will make life for people I know and
myself if you can help me!

"Mike H" wrote:

I don't believe you can do it with Vlookup but you can do it with Index. The
formula below has the following arguments:-

A2:B500. the lookup array
J1 = what to look for
K1 the instance to look for 1 for first or 2 for 2nd etc
It returns the value from the second column (The last 2 in the formula.
It's an array so Ctrl+shift+enter


=INDEX($A$2:$B500,SMALL(IF($A$2:$B500=$J$1,ROW($A$ 2:$B500)-ROW($A$2)+1,ROW($B500)+1),K1),2)

Mike

"Jen" wrote:


Is it possible to do a formula within a VLOOKUP when the return answer could
be more than one thing.
I.e., if I have a list of property numbers but there are several lease
numbers for each one. I only want to pull back property 123 is it has lease 4
as well. It may have lease 1, 2, 3. Normally with a vlookup it brings back
only the first answer whereas I need to lookup the answer too.
If that makes sense...

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default vlookups with multiple answers

Jen,

It's the B1 in the formula that's the problem, it's inside the array. Change
it to C1.

=INDEX(A1:B7,SMALL(IF(A1:B7=C1,ROW(A1:B7)-ROW(A1)+1,ROW(B7)+1),K1),2)

This works fine.

Mike

"Jen" wrote:

I've tried this and it's coming up #NUM! I can see the logic in the formula
but can't see where I'm going wrong. Here is my formula-
=INDEX(A1:B7,SMALL(IF(A1:B7=B1,ROW(A1:B7)-ROW(A1)+1,ROW(B7)+1),K1),2)

And ideas?
My array is:
Ashish 234
Sanjay 334
Pongal 434
Ashish 534
Rajesh 634
Suresh 734
Ashish 834


You cannot imagine how much easier this will make life for people I know and
myself if you can help me!

"Mike H" wrote:

I don't believe you can do it with Vlookup but you can do it with Index. The
formula below has the following arguments:-

A2:B500. the lookup array
J1 = what to look for
K1 the instance to look for 1 for first or 2 for 2nd etc
It returns the value from the second column (The last 2 in the formula.
It's an array so Ctrl+shift+enter


=INDEX($A$2:$B500,SMALL(IF($A$2:$B500=$J$1,ROW($A$ 2:$B500)-ROW($A$2)+1,ROW($B500)+1),K1),2)

Mike

"Jen" wrote:


Is it possible to do a formula within a VLOOKUP when the return answer could
be more than one thing.
I.e., if I have a list of property numbers but there are several lease
numbers for each one. I only want to pull back property 123 is it has lease 4
as well. It may have lease 1, 2, 3. Normally with a vlookup it brings back
only the first answer whereas I need to lookup the answer too.
If that makes sense...

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
Multiple VLookups - Can anyone help me please? certain_death Excel Discussion (Misc queries) 5 February 14th 06 06:42 PM
Sum a row of multiple vlookups jtgostars Excel Worksheet Functions 1 December 10th 05 06:37 PM
Multiple Vlookups shaj Excel Worksheet Functions 2 November 18th 05 06:32 PM
multiple vlookups inthestands Excel Worksheet Functions 0 January 13th 05 06:35 PM
multiple vlookups inthestands Excel Worksheet Functions 1 January 12th 05 09:07 PM


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

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"