#1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 1
Default Vlookup

I am trying to find two different types of data that come from the same
person. For Example:

Name ID Date In Date Out
Adam 001234 12/12/07 12/11/08
Adam 001234 12/12/08 12/11/09

I need to use the ID number as the lookup value. When I use =Vlookup to find
the date out for Adam I can only get the first one, 12/11/08. I am assuming
it is because they are the same number, but is there any way to use the
second ID number in the column to get the second date, 12/11/09?

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 15,768
Default Vlookup

Assume your data is in the range A2:D10

You want the reasults to appear starting in cell G2 downwards.

F2 = 001234

If your data is sorted or grouped together by ID number:

Entered in G2 and copied down until you get blanks:

=IF(ROWS(G$2:G2)<=COUNTIF(B$2:B$10,F$2),INDEX(D$2: D$10,MATCH(F$2,B$2:B$10,0)+ROWS(G$2:G2)-1),"")

If your data is in random order then this array formula** :

=IF(ROWS(G$2:G2)<=COUNTIF(B$2:B$10,F$2),SMALL(IF(B $2:B$10=F$2,D$2:D$10),ROWS(G$2:G2)),"")

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.

Format as Date

--
Biff
Microsoft Excel MVP


"lefdogg" wrote in message
...
I am trying to find two different types of data that come from the same
person. For Example:

Name ID Date In Date Out
Adam 001234 12/12/07 12/11/08
Adam 001234 12/12/08 12/11/09

I need to use the ID number as the lookup value. When I use =Vlookup to
find
the date out for Adam I can only get the first one, 12/11/08. I am
assuming
it is because they are the same number, but is there any way to use the
second ID number in the column to get the second date, 12/11/09?

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 320
Default Vlookup

There's an easier way.
Put the ID in F2, then in G2 enter this:
=MATCH($F$2,OFFSET($B$1,G1,0,1000,1),0)+G1
and fill down. This will give you the ROW#s of where the ID appears. So in
H2, you can simply use
=INDEX(D:D,G2) and fill down
Format G as date, hide F
You can also hide the #N/A you get when you fill down farther than there's
information using conditional formatting.

Bob Umlas
Excel MVP
"T. Valko" wrote:

Assume your data is in the range A2:D10

You want the reasults to appear starting in cell G2 downwards.

F2 = 001234

If your data is sorted or grouped together by ID number:

Entered in G2 and copied down until you get blanks:

=IF(ROWS(G$2:G2)<=COUNTIF(B$2:B$10,F$2),INDEX(D$2: D$10,MATCH(F$2,B$2:B$10,0)+ROWS(G$2:G2)-1),"")

If your data is in random order then this array formula** :

=IF(ROWS(G$2:G2)<=COUNTIF(B$2:B$10,F$2),SMALL(IF(B $2:B$10=F$2,D$2:D$10),ROWS(G$2:G2)),"")

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.

Format as Date

--
Biff
Microsoft Excel MVP


"lefdogg" wrote in message
...
I am trying to find two different types of data that come from the same
person. For Example:

Name ID Date In Date Out
Adam 001234 12/12/07 12/11/08
Adam 001234 12/12/08 12/11/09

I need to use the ID number as the lookup value. When I use =Vlookup to
find
the date out for Adam I can only get the first one, 12/11/08. I am
assuming
it is because they are the same number, but is there any way to use the
second ID number in the column to get the second date, 12/11/09?

Thanks




  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 15,768
Default Vlookup

There's an easier way.

Easy being relative!

--
Biff
Microsoft Excel MVP


"Bob Umlas, Excel MVP" wrote in
message ...
There's an easier way.
Put the ID in F2, then in G2 enter this:
=MATCH($F$2,OFFSET($B$1,G1,0,1000,1),0)+G1
and fill down. This will give you the ROW#s of where the ID appears. So in
H2, you can simply use
=INDEX(D:D,G2) and fill down
Format G as date, hide F
You can also hide the #N/A you get when you fill down farther than there's
information using conditional formatting.

Bob Umlas
Excel MVP
"T. Valko" wrote:

Assume your data is in the range A2:D10

You want the reasults to appear starting in cell G2 downwards.

F2 = 001234

If your data is sorted or grouped together by ID number:

Entered in G2 and copied down until you get blanks:

=IF(ROWS(G$2:G2)<=COUNTIF(B$2:B$10,F$2),INDEX(D$2: D$10,MATCH(F$2,B$2:B$10,0)+ROWS(G$2:G2)-1),"")

If your data is in random order then this array formula** :

=IF(ROWS(G$2:G2)<=COUNTIF(B$2:B$10,F$2),SMALL(IF(B $2:B$10=F$2,D$2:D$10),ROWS(G$2:G2)),"")

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the
SHIFT
key then hit ENTER.

Format as Date

--
Biff
Microsoft Excel MVP


"lefdogg" wrote in message
...
I am trying to find two different types of data that come from the same
person. For Example:

Name ID Date In Date Out
Adam 001234 12/12/07 12/11/08
Adam 001234 12/12/08 12/11/09

I need to use the ID number as the lookup value. When I use =Vlookup to
find
the date out for Adam I can only get the first one, 12/11/08. I am
assuming
it is because they are the same number, but is there any way to use the
second ID number in the column to get the second date, 12/11/09?

Thanks






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
VLookUp - Does the VLookUp return the exact information? Cpviv Excel Worksheet Functions 2 October 28th 08 09:57 AM
Vlookup in vlookup - taking the result as array name SupperDuck Excel Worksheet Functions 2 June 2nd 07 11:05 AM
Combine VLOOKUP and IF function so #NA isn't returned as a value from VLOOKUP buffgirl71 Excel Discussion (Misc queries) 12 November 14th 06 11:36 PM
Vlookup -=VLOOKUP(F9,LookUp1!$A$2:$B$1504,2,FALSE) MikeR-Oz New Users to Excel 1 March 22nd 06 09:01 AM
Vlookup info being used without vlookup table attached? Excel Worksheet Functions 0 January 25th 05 10:43 AM


All times are GMT +1. The time now is 08:34 AM.

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"