LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Finding a date in between a range of dates.

"Abro via OfficeKB.com" <u21539@uwe wrote in message
news:70e6b45e5194a@uwe...
A formula would probably be easier but I know a little about macros and

have
been checking into both.

Abro wrote:
Yes it is just sample info. I meant to have the end date of record 003 to

be
a day before the start date of record 002. Sorry about that.

is this exact example of data, or just info?
because, your example of 10/28/2005 has *two* matches, record #003 and

[quoted text clipped - 7 lines]
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200704/1


--
Message posted via http://www.officekb.com



formula solution uses "vlookup(value;range;kolumn_result)" which needs data
to be sorted ascending on lookup column. returns row which is equal or
smaller.

so your data:

A B C D
Record# Start Date End Date Disc
001 4/15/2006 4/15/2007 12.5
002 3/15/2005 4/14/2006 13.5
003 2/15/2004 3/14/2005 14.2

needs to be sorted on column B Start Date like:

A B C D
Record# Start Date End Date Disc
003 2/15/2004 3/14/2005 14.2
002 3/15/2005 4/14/2006 13.5
001 4/15/2006 4/15/2007 12.5

to retreive value, put formula
=vlookup(ref_cell,$B$2:$D$4,3)
where ref_cell contains data you are looking for, f.e 10/28/2005, and it
returns 13.5 since Start Date 3/15/2005 is less or equal of searched date
10/28/2005

this solution suppose that all intervals are covered, and there is no date
without Disc value








 
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
finding dates in a range NigelShaw Excel Discussion (Misc queries) 4 December 2nd 09 02:18 AM
finding if a date falls between two dates JeanetteS[_2_] Excel Discussion (Misc queries) 2 February 10th 09 09:54 PM
finding a range of dates to total Danbmarine Excel Discussion (Misc queries) 4 January 27th 06 09:28 PM
Finding dates within a date range Marcus Excel Worksheet Functions 2 April 5th 05 02:03 AM
Finding Dates in a date range Marcus Excel Discussion (Misc queries) 1 April 5th 05 01:51 AM


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