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 with two recors



 
 
Thread Tools Display Modes
  #1  
Old April 22nd, 2010, 12:16 PM posted to microsoft.public.excel.worksheet.functions
siva_vlookup
external usenet poster
 
Posts: 1
Default vlookup with two recors

Hi,

while performing vlookup, if the lookup value has two records in a column,
how to identify the first and second one.
  #2  
Old April 22nd, 2010, 12:27 PM posted to microsoft.public.excel.worksheet.functions
Mike H
external usenet poster
 
Posts: 8,419
Default vlookup with two recors

Hi,

Your a bit short on detail but here's a lookup that will find the first and
other matches. It's an ARRAY formula see below on how to enter it.

The lookup value is in E1 and it looks up column A and returns column B

Array enter the formula and it will return the first match. Drag down for
the second match and third match etc. It will return blanks when the matches
run out.

=IF(ROWS(B$1:B1)=COUNTIF($A$1:$A$20,$E$1),INDEX($ B$1:$B$20,SMALL(IF($A$1:$A$20=$E$1,ROW($A$1:$A$20)-ROW($E$1)+1),ROWS(B$1:B1))),"")

This is an array formula which must be entered by pressing CTRL+Shift+Enter
and not just Enter. If you do it correctly then Excel will put curly brackets
around the formula {}. You can't type these yourself. If you edit the formula
you must enter it again with CTRL+Shift+Enter.
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"siva_vlookup" wrote:

Hi,

while performing vlookup, if the lookup value has two records in a column,
how to identify the first and second one.

 




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 10:20 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.