Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default Return a value when Date x is between Date y and z

Hi,

I have a table something like this:

A B C
1 From To Result
2 01/07/2009 01/07/2010 0-1
3 01/07/2010 01/07/2011 1-2
4 01/07/2011 01/07/2012 2-3
5 01/07/2012 01/07/2013 3-4

In another column (X) I have a list of Dates and I want return the
"result" from the row where the date lies between. So for example in
X3 I have 16/10/2011 and I can see this date is between the 2 dates in
row 4 in the table above so I want to return "2-3"

I've tried an array formula something like {=IF(AND
(X3A2:A17,X3<A2:A17),C2:C17,"None")} but this doesn't do the trick.

Any suggestions welcome

Thanks

...pc
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,276
Default Return a value when Date x is between Date y and z

Hi,
try

=VLOOKUP(x3,A1:C5,3)

"PMC1" wrote:

Hi,

I have a table something like this:

A B C
1 From To Result
2 01/07/2009 01/07/2010 0-1
3 01/07/2010 01/07/2011 1-2
4 01/07/2011 01/07/2012 2-3
5 01/07/2012 01/07/2013 3-4

In another column (X) I have a list of Dates and I want return the
"result" from the row where the date lies between. So for example in
X3 I have 16/10/2011 and I can see this date is between the 2 dates in
row 4 in the table above so I want to return "2-3"

I've tried an array formula something like {=IF(AND
(X3A2:A17,X3<A2:A17),C2:C17,"None")} but this doesn't do the trick.

Any suggestions welcome

Thanks

...pc

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default Return a value when Date x is between Date y and z

On Jul 30, 1:13*pm, Eduardo wrote:
Hi,
try

=VLOOKUP(x3,A1:C5,3)

"PMC1" wrote:
Hi,


I have a table something like this:


* * * * * * A * * * * * * * * * * * *B * * * * * * * * C
1 * * * From * * * * * * * *To * * * * * * * * Result
2 * * * 01/07/2009 * * *01/07/2010 * * *0-1
3 * * * 01/07/2010 * * *01/07/2011 * * *1-2
4 * * * 01/07/2011 * * *01/07/2012 * * *2-3
5 * * * 01/07/2012 * * *01/07/2013 * * *3-4


In another column (X) I have a list of Dates and I want return the
"result" from the row where the date lies between. So for example in
X3 I have 16/10/2011 and I can see this date is between the 2 dates in
row 4 in the table above so I want to return "2-3"


I've tried an array formula something like {=IF(AND
(X3A2:A17,X3<A2:A17),C2:C17,"None")} but this doesn't do the trick.


Any suggestions welcome


Thanks


...pc


Hi Eduardo,

Thanks for your reply.

I'm looking to return the value in column C where the the value of X3
is BETWEEN the value in the A and B so if the value if X3 is between
the dates in A3 and B3 the this would return "1-2"

...pc
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,276
Default Return a value when Date x is between Date y and z

Hi,
The formula given is doing what you need if I enter 16/10/2010 it change to
1-2

"PMC1" wrote:

On Jul 30, 1:13 pm, Eduardo wrote:
Hi,
try

=VLOOKUP(x3,A1:C5,3)

"PMC1" wrote:
Hi,


I have a table something like this:


A B C
1 From To Result
2 01/07/2009 01/07/2010 0-1
3 01/07/2010 01/07/2011 1-2
4 01/07/2011 01/07/2012 2-3
5 01/07/2012 01/07/2013 3-4


In another column (X) I have a list of Dates and I want return the
"result" from the row where the date lies between. So for example in
X3 I have 16/10/2011 and I can see this date is between the 2 dates in
row 4 in the table above so I want to return "2-3"


I've tried an array formula something like {=IF(AND
(X3A2:A17,X3<A2:A17),C2:C17,"None")} but this doesn't do the trick.


Any suggestions welcome


Thanks


...pc


Hi Eduardo,

Thanks for your reply.

I'm looking to return the value in column C where the the value of X3
is BETWEEN the value in the A and B so if the value if X3 is between
the dates in A3 and B3 the this would return "1-2"

...pc

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default Return a value when Date x is between Date y and z

On Jul 30, 1:42*pm, Eduardo wrote:
Hi,
The formula given is doing what you need if I enter 16/10/2010 it change to
1-2

"PMC1" wrote:
On Jul 30, 1:13 pm, Eduardo wrote:
Hi,
try


=VLOOKUP(x3,A1:C5,3)


"PMC1" wrote:
Hi,


I have a table something like this:


* * * * * * A * * * * * * * * * * * *B * * * * * * * * C
1 * * * From * * * * * * * *To * * * * * * * * Result
2 * * * 01/07/2009 * * *01/07/2010 * * *0-1
3 * * * 01/07/2010 * * *01/07/2011 * * *1-2
4 * * * 01/07/2011 * * *01/07/2012 * * *2-3
5 * * * 01/07/2012 * * *01/07/2013 * * *3-4


In another column (X) I have a list of Dates and I want return the
"result" from the row where the date lies between. So for example in
X3 I have 16/10/2011 and I can see this date is between the 2 dates in
row 4 in the table above so I want to return "2-3"


I've tried an array formula something like {=IF(AND
(X3A2:A17,X3<A2:A17),C2:C17,"None")} but this doesn't do the trick..


Any suggestions welcome


Thanks


...pc


Hi Eduardo,


Thanks for your reply.


I'm looking to return the value in column C where the the value of X3
is BETWEEN the value in the A and B so if the value if X3 is between
the dates in A3 and B3 the this would return "1-2"


...pc


Eduardo, you are indeed correct - I didn't think about the vlookup
using "approx match".

Thanks for your help


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
from date return week date range ERahn Excel Worksheet Functions 3 December 2nd 06 02:28 AM
return a date from range, date is between dates in two other cells NN Excel Discussion (Misc queries) 1 September 28th 06 10:05 PM
Date Function formula that will return the date of a specific week Greg Excel Worksheet Functions 4 June 12th 06 05:07 PM
Date formula: return Quarter and Fiscal Year of a date Rob Excel Discussion (Misc queries) 7 May 11th 05 08:48 PM
calc constant date from variable date & return with ability to rn. SusieQ'sQuest Excel Worksheet Functions 1 November 9th 04 08:51 PM


All times are GMT +1. The time now is 09:06 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"