A Microsoft Office (Excel, Word) forum. OfficeFrustration

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 » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Vlookup - Returning 2nd match



 
 
Thread Tools Display Modes
  #1  
Old April 29th, 2010, 04:06 AM posted to microsoft.public.excel.worksheet.functions
MarkinArk
external usenet poster
 
Posts: 2
Default Vlookup - Returning 2nd match

Quick question on returning the 2nd match of a vlookup . I am tracking
multiple major league baseball teams' win/loss streaks, and have the results
listed by date. I was doing fine, until the Mets and Dodgers had a
double-header yesterday, and now had 2 entries for that date. I know I can
test for multiple dates using Countif(A1:A4 4/27/2010) but don't know how to
return the 2nd match of the row of the vlookup.
A B
4/26/2010 POSTPONED
4/27/2010 W 4-0
4/27/2010 W 10-5
4/28/2010 W 7-3

vlookup(4/27/2010, a1:b4, 2, false) so that I get W 10-5 (where the first
vlookup returns W 4-0). Thanks for any help.

Mark
  #2  
Old April 29th, 2010, 04:48 AM posted to microsoft.public.excel.worksheet.functions
ozgrid.com
external usenet poster
 
Posts: 328
Default Vlookup - Returning 2nd match

See
http://www.ozgrid.com/VBA/ultimate-e...p-function.htm



--
Regards
Dave Hawley
www.ozgrid.com
"MarkinArk" wrote in message
...
Quick question on returning the 2nd match of a vlookup . I am tracking
multiple major league baseball teams' win/loss streaks, and have the
results
listed by date. I was doing fine, until the Mets and Dodgers had a
double-header yesterday, and now had 2 entries for that date. I know I
can
test for multiple dates using Countif(A1:A4 4/27/2010) but don't know how
to
return the 2nd match of the row of the vlookup.
A B
4/26/2010 POSTPONED
4/27/2010 W 4-0
4/27/2010 W 10-5
4/28/2010 W 7-3

vlookup(4/27/2010, a1:b4, 2, false) so that I get W 10-5 (where the
first
vlookup returns W 4-0). Thanks for any help.

Mark


  #3  
Old April 29th, 2010, 05:43 AM posted to microsoft.public.excel.worksheet.functions
Jacob Skaria
external usenet poster
 
Posts: 5,952
Default Vlookup - Returning 2nd match

Try the below with lookup value in cell C1 and the lookup instance in cell
C2. In your case the lookup instance is 2.

Please note that this is an array formula. You create array formulas in the
same way that you create other formulas, except you press CTRL+SHIFT+ENTER to
enter the formula. If successful in 'Formula Bar' you can notice the curly
braces at both ends like "{=formula}"

=INDEX(B1:B100,SMALL(IF(A1:A100=C1,ROW(A1:A100)),C 2))

--
Jacob (MVP - Excel)


"MarkinArk" wrote:

Quick question on returning the 2nd match of a vlookup . I am tracking
multiple major league baseball teams' win/loss streaks, and have the results
listed by date. I was doing fine, until the Mets and Dodgers had a
double-header yesterday, and now had 2 entries for that date. I know I can
test for multiple dates using Countif(A1:A4 4/27/2010) but don't know how to
return the 2nd match of the row of the vlookup.
A B
4/26/2010 POSTPONED
4/27/2010 W 4-0
4/27/2010 W 10-5
4/28/2010 W 7-3

vlookup(4/27/2010, a1:b4, 2, false) so that I get W 10-5 (where the first
vlookup returns W 4-0). Thanks for any help.

Mark

  #4  
Old May 9th, 2010, 05:31 AM posted to microsoft.public.excel.worksheet.functions
Ashish Mathur[_2_]
external usenet poster
 
Posts: 1,764
Default Vlookup - Returning 2nd match

Hi,

You may refer to my article here -
http://office.microsoft.com/en-gb/ex...260381033.aspx

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"MarkinArk" wrote in message
...
Quick question on returning the 2nd match of a vlookup . I am tracking
multiple major league baseball teams' win/loss streaks, and have the
results
listed by date. I was doing fine, until the Mets and Dodgers had a
double-header yesterday, and now had 2 entries for that date. I know I
can
test for multiple dates using Countif(A1:A4 4/27/2010) but don't know how
to
return the 2nd match of the row of the vlookup.
A B
4/26/2010 POSTPONED
4/27/2010 W 4-0
4/27/2010 W 10-5
4/28/2010 W 7-3

vlookup(4/27/2010, a1:b4, 2, false) so that I get W 10-5 (where the
first
vlookup returns W 4-0). Thanks for any help.

Mark


  #5  
Old May 9th, 2010, 10:20 AM posted to microsoft.public.excel.worksheet.functions
Bernd P
external usenet poster
 
Posts: 613
Default Vlookup - Returning 2nd match

On 29 Apr., 04:48, "ozgrid.com" wrote:
Seehttp://www.ozgrid.com/VBA/ultimate-excel-lookup-function.htm

--
Regards
Dave Hawleywww.ozgrid.com"MarkinArk" wrote in message

...

Quick question on returning the 2nd match of a vlookup . *I am tracking
multiple major league baseball teams' win/loss streaks, and have the
results
listed by date. *I was doing fine, until the Mets and Dodgers had a
double-header yesterday, and now had 2 entries for that date. *I know I
can
test for multiple dates using Countif(A1:A4 4/27/2010) but don't know how
to
return the 2nd match of the row of the vlookup.
* *A * * * * * * B
4/26/2010 POSTPONED
4/27/2010 W 4-0
4/27/2010 W 10-5
4/28/2010 W 7-3


vlookup(4/27/2010, a1:b4, 2, false) * so that I get W 10-5 (where the
first
vlookup returns W 4-0). *Thanks for any help.


Mark


Hello Dave,

That's some nice piece of code.

Two suggestions: You can enhance the functionality to lookup the last
value of a range (for example Occurence = -1) or the last but one
(Occurrence = -2), etc. by changing the search direction if Occurence
is negative (and taking -Occurrence). And I would omit Column_Lookin
to shorten the code:
http://sulprobil.com/html/lookup-variants.html

Regards,
Bernd

 




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 Off
HTML code is Off
Forum Jump


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


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