#1   Report Post  
Posted to microsoft.public.excel.misc
Dom Dom is offline
external usenet poster
 
Posts: 46
Default Vlookup Next

I am trying to create a calender in excel. What I want to be able to do is
list dates and events in a list form and then do a lookup function so it puts
the event by the proper day. My problem is if there is 2 events on the same
day, it will always return the first event vlookup finds for that date. How
do i get past that so vlookup will look for the next event here is the data
as it appears. Column A represents the calender and the date I want to
lookup. Colum B is the day of the event and c is the event.

A B C
1/2/2010 1/1/2010 New Years Day Bowl games
1/3/2010 1/25/2010 Moms Birthday
1/4/2010 1/10/2010 Dads Birthday
1/5/2010 1/24/2010 Students Return
1/6/2010 1/24/2010 Fun time Project
1/30/2010 Class Begins
1/1/2010 Work on Excel Program

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Vlookup Next

Have you considered applying a filter to the data instead of using a formula?
It will work out a whole pile easier.
--
HTH...

Jim Thomlinson


"Dom" wrote:

I am trying to create a calender in excel. What I want to be able to do is
list dates and events in a list form and then do a lookup function so it puts
the event by the proper day. My problem is if there is 2 events on the same
day, it will always return the first event vlookup finds for that date. How
do i get past that so vlookup will look for the next event here is the data
as it appears. Column A represents the calender and the date I want to
lookup. Colum B is the day of the event and c is the event.

A B C
1/2/2010 1/1/2010 New Years Day Bowl games
1/3/2010 1/25/2010 Moms Birthday
1/4/2010 1/10/2010 Dads Birthday
1/5/2010 1/24/2010 Students Return
1/6/2010 1/24/2010 Fun time Project
1/30/2010 Class Begins
1/1/2010 Work on Excel Program

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Vlookup Next

Hi,

Try this array formula (see below for array formula entry) It looks up a1 in
B1 - B13 and returns column C very similar to VLOOKUP except there is another
parameter. E1 contains the instance to lookup. So if e1 is a 1 it behaves
exactly like Vlookup but with a 2 in e1 it looks for the second match or
third etc for 3

=INDEX(C1:C13,LARGE((B1:B13=A1)*ROW(A1:A13),COUNTI F(B1:B13,E1)+1-F1))

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

"Dom" wrote:

I am trying to create a calender in excel. What I want to be able to do is
list dates and events in a list form and then do a lookup function so it puts
the event by the proper day. My problem is if there is 2 events on the same
day, it will always return the first event vlookup finds for that date. How
do i get past that so vlookup will look for the next event here is the data
as it appears. Column A represents the calender and the date I want to
lookup. Colum B is the day of the event and c is the event.

A B C
1/2/2010 1/1/2010 New Years Day Bowl games
1/3/2010 1/25/2010 Moms Birthday
1/4/2010 1/10/2010 Dads Birthday
1/5/2010 1/24/2010 Students Return
1/6/2010 1/24/2010 Fun time Project
1/30/2010 Class Begins
1/1/2010 Work on Excel Program

  #4   Report Post  
Posted to microsoft.public.excel.misc
Dom Dom is offline
external usenet poster
 
Posts: 46
Default Vlookup Next

I did think of that, but the calendar is on a seperate sheet from the data,
in a calendar looking format. I don't know how to use a filter on a different
sheet than the one the data is already on. If you know how to that would
help me as well.

Dom

"Jim Thomlinson" wrote:

Have you considered applying a filter to the data instead of using a formula?
It will work out a whole pile easier.
--
HTH...

Jim Thomlinson


"Dom" wrote:

I am trying to create a calender in excel. What I want to be able to do is
list dates and events in a list form and then do a lookup function so it puts
the event by the proper day. My problem is if there is 2 events on the same
day, it will always return the first event vlookup finds for that date. How
do i get past that so vlookup will look for the next event here is the data
as it appears. Column A represents the calender and the date I want to
lookup. Colum B is the day of the event and c is the event.

A B C
1/2/2010 1/1/2010 New Years Day Bowl games
1/3/2010 1/25/2010 Moms Birthday
1/4/2010 1/10/2010 Dads Birthday
1/5/2010 1/24/2010 Students Return
1/6/2010 1/24/2010 Fun time Project
1/30/2010 Class Begins
1/1/2010 Work on Excel Program

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Vlookup Next

ooPS,

II got a typo in that formula, try this one instead

=INDEX(C1:C13,LARGE((B1:B13=A1)*ROW(A1:A13),COUNTI F(B1:B13,A1)+1-E1))

Mike

"Mike H" wrote:

Hi,

Try this array formula (see below for array formula entry) It looks up a1 in
B1 - B13 and returns column C very similar to VLOOKUP except there is another
parameter. E1 contains the instance to lookup. So if e1 is a 1 it behaves
exactly like Vlookup but with a 2 in e1 it looks for the second match or
third etc for 3

=INDEX(C1:C13,LARGE((B1:B13=A1)*ROW(A1:A13),COUNTI F(B1:B13,E1)+1-F1))

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

"Dom" wrote:

I am trying to create a calender in excel. What I want to be able to do is
list dates and events in a list form and then do a lookup function so it puts
the event by the proper day. My problem is if there is 2 events on the same
day, it will always return the first event vlookup finds for that date. How
do i get past that so vlookup will look for the next event here is the data
as it appears. Column A represents the calender and the date I want to
lookup. Colum B is the day of the event and c is the event.

A B C
1/2/2010 1/1/2010 New Years Day Bowl games
1/3/2010 1/25/2010 Moms Birthday
1/4/2010 1/10/2010 Dads Birthday
1/5/2010 1/24/2010 Students Return
1/6/2010 1/24/2010 Fun time Project
1/30/2010 Class Begins
1/1/2010 Work on Excel Program



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 698
Default Vlookup Next

Hi Mike,

INDEX(C1:C13,LARGE((B1:B13=A1)*ROW(A1:A13),COUNTIF (B1:B13,A1)+1-E1))

I like your formula. A questions if you don't mind. Is the
....*ROW(A1:A13),... to comply with a requirement that both ranges
Column A and B must be the same size? If I try just A1 I get an incorrect
return, namely the first value of column B.

Regards,
Howard

"Mike H" wrote in message
...
Hi,

Try this array formula (see below for array formula entry) It looks up a1
in
B1 - B13 and returns column C very similar to VLOOKUP except there is
another
parameter. E1 contains the instance to lookup. So if e1 is a 1 it behaves
exactly like Vlookup but with a 2 in e1 it looks for the second match or
third etc for 3

=INDEX(C1:C13,LARGE((B1:B13=A1)*ROW(A1:A13),COUNTI F(B1:B13,E1)+1-F1))

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

"Dom" wrote:

I am trying to create a calender in excel. What I want to be able to do
is
list dates and events in a list form and then do a lookup function so it
puts
the event by the proper day. My problem is if there is 2 events on the
same
day, it will always return the first event vlookup finds for that date.
How
do i get past that so vlookup will look for the next event here is the
data
as it appears. Column A represents the calender and the date I want to
lookup. Colum B is the day of the event and c is the event.

A B C
1/2/2010 1/1/2010 New Years Day Bowl games
1/3/2010 1/25/2010 Moms Birthday
1/4/2010 1/10/2010 Dads Birthday
1/5/2010 1/24/2010 Students Return
1/6/2010 1/24/2010 Fun time Project
1/30/2010 Class Begins
1/1/2010 Work on Excel Program



  #7   Report Post  
Posted to microsoft.public.excel.misc
Dom Dom is offline
external usenet poster
 
Posts: 46
Default Vlookup Next

Mike Thanks that worked, i tried figuring that formula out from one of your
early posts but couldn't get it to work. Now i understand it. Thanks for the
help.

"Mike H" wrote:

ooPS,

II got a typo in that formula, try this one instead

=INDEX(C1:C13,LARGE((B1:B13=A1)*ROW(A1:A13),COUNTI F(B1:B13,A1)+1-E1))

Mike

"Mike H" wrote:

Hi,

Try this array formula (see below for array formula entry) It looks up a1 in
B1 - B13 and returns column C very similar to VLOOKUP except there is another
parameter. E1 contains the instance to lookup. So if e1 is a 1 it behaves
exactly like Vlookup but with a 2 in e1 it looks for the second match or
third etc for 3

=INDEX(C1:C13,LARGE((B1:B13=A1)*ROW(A1:A13),COUNTI F(B1:B13,E1)+1-F1))

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

"Dom" wrote:

I am trying to create a calender in excel. What I want to be able to do is
list dates and events in a list form and then do a lookup function so it puts
the event by the proper day. My problem is if there is 2 events on the same
day, it will always return the first event vlookup finds for that date. How
do i get past that so vlookup will look for the next event here is the data
as it appears. Column A represents the calender and the date I want to
lookup. Colum B is the day of the event and c is the event.

A B C
1/2/2010 1/1/2010 New Years Day Bowl games
1/3/2010 1/25/2010 Moms Birthday
1/4/2010 1/10/2010 Dads Birthday
1/5/2010 1/24/2010 Students Return
1/6/2010 1/24/2010 Fun time Project
1/30/2010 Class Begins
1/1/2010 Work on Excel Program

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Vlookup Next

Hi,

That bit of the formula produces an array of the rows in which there is a
match so for the data below we get

=INDEX(C1:C13,LARGE({0;0;3;0;0;0;0;0;0;0;0;0;0},CO UNTIF(B1:B13,A1)+1-E1))

i.e the only match is in row 3 so it must be the same size as the other
ranges.

A B C
44 1 11
2 12
44 13
5 14
6 15
7 16
8 17
9 18
10 19
11 20
12 21
13 22
14 23

Mike

"L. Howard Kittle" wrote:

Hi Mike,

INDEX(C1:C13,LARGE((B1:B13=A1)*ROW(A1:A13),COUNTIF (B1:B13,A1)+1-E1))

I like your formula. A questions if you don't mind. Is the
....*ROW(A1:A13),... to comply with a requirement that both ranges
Column A and B must be the same size? If I try just A1 I get an incorrect
return, namely the first value of column B.

Regards,
Howard

"Mike H" wrote in message
...
Hi,

Try this array formula (see below for array formula entry) It looks up a1
in
B1 - B13 and returns column C very similar to VLOOKUP except there is
another
parameter. E1 contains the instance to lookup. So if e1 is a 1 it behaves
exactly like Vlookup but with a 2 in e1 it looks for the second match or
third etc for 3

=INDEX(C1:C13,LARGE((B1:B13=A1)*ROW(A1:A13),COUNTI F(B1:B13,E1)+1-F1))

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

"Dom" wrote:

I am trying to create a calender in excel. What I want to be able to do
is
list dates and events in a list form and then do a lookup function so it
puts
the event by the proper day. My problem is if there is 2 events on the
same
day, it will always return the first event vlookup finds for that date.
How
do i get past that so vlookup will look for the next event here is the
data
as it appears. Column A represents the calender and the date I want to
lookup. Colum B is the day of the event and c is the event.

A B C
1/2/2010 1/1/2010 New Years Day Bowl games
1/3/2010 1/25/2010 Moms Birthday
1/4/2010 1/10/2010 Dads Birthday
1/5/2010 1/24/2010 Students Return
1/6/2010 1/24/2010 Fun time Project
1/30/2010 Class Begins
1/1/2010 Work on Excel Program




  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Vlookup Next

You are most welcome

"Dom" wrote:

Mike Thanks that worked, i tried figuring that formula out from one of your
early posts but couldn't get it to work. Now i understand it. Thanks for the
help.

"Mike H" wrote:

ooPS,

II got a typo in that formula, try this one instead

=INDEX(C1:C13,LARGE((B1:B13=A1)*ROW(A1:A13),COUNTI F(B1:B13,A1)+1-E1))

Mike

"Mike H" wrote:

Hi,

Try this array formula (see below for array formula entry) It looks up a1 in
B1 - B13 and returns column C very similar to VLOOKUP except there is another
parameter. E1 contains the instance to lookup. So if e1 is a 1 it behaves
exactly like Vlookup but with a 2 in e1 it looks for the second match or
third etc for 3

=INDEX(C1:C13,LARGE((B1:B13=A1)*ROW(A1:A13),COUNTI F(B1:B13,E1)+1-F1))

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

"Dom" wrote:

I am trying to create a calender in excel. What I want to be able to do is
list dates and events in a list form and then do a lookup function so it puts
the event by the proper day. My problem is if there is 2 events on the same
day, it will always return the first event vlookup finds for that date. How
do i get past that so vlookup will look for the next event here is the data
as it appears. Column A represents the calender and the date I want to
lookup. Colum B is the day of the event and c is the event.

A B C
1/2/2010 1/1/2010 New Years Day Bowl games
1/3/2010 1/25/2010 Moms Birthday
1/4/2010 1/10/2010 Dads Birthday
1/5/2010 1/24/2010 Students Return
1/6/2010 1/24/2010 Fun time Project
1/30/2010 Class Begins
1/1/2010 Work on Excel Program

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 11:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"