Formula for matching a date within a date range in excel
Formula in C9:
=INDEX(B3:B6, SUMPRODUCT(--(DATEVALUE(LEFT(C3:C6, FIND("/", C3:C6)-1))<=C8), --(DATEVALUE(RIGHT(C3:C6, LEN(C3:C6)-FIND("/", C3:C6)))>=C8), ROW(C3:C6)-MIN(ROW(C3:C6))+1)) + ENTER
Download excel file for this tutorial.
matching a date in a date range.xls
(Excel 97-2003 Workbook *.xls)
Functions in this article:
SUMPRODUCT(array1, array2, )
Returns the sum of the products of the corresponding ranges or arrays
LEFT(text;num_chars) Returns the specified number of characters from the start of textstring
RIGHT(text;num_chars) returns the specified number of characters from the end of textstring
ROW(reference) Returns the rownumber of a reference
FIND(find_text;within_text;[start_num]) Returns the starting position of one text string within another text string. FIND is case-sensitive
LEN(text)
Returns the number of characters in a text string
DATEVALUE(date_text)
Converts a date in the form of text to a number that represents the date in Microsoft Office Excel date-time code
Related blog posts
- Count matching cells in date range in excel
- Create a date range using excel formula
- Filter unique distinct text values using “begins with” criterion in a range using array formula in excel
- Remove duplicate text strings based on the 4 last characters in a cell in excel
- Text to columns: Split words in a cell (excel array formula)







December 14th, 2009 at 1:31 am
This much shorter formula appears to work also...
=LOOKUP(C8,RIGHT(C$3:C$6,10)-91+(C8=--(YEAR(C8)&"-03-31")),B$3:B$6)
December 15th, 2009 at 8:51 pm
Very interesting! Thanks!
January 12th, 2010 at 11:45 pm
Hi,
What type of formula could be used if you weren't using a date range and your data was not concatenated?
ie: Input Value 1.78 should return a Value of B as it is between the values in Range1 and Range2
Range1 Range2 Value
1.33 1.66 A
1.67 1.99 B
2.00 2.33 C
January 13th, 2010 at 12:13 pm
MT,
see this post: http://www.get-digital-help.com/2010/01/13/return-value-if-in-range-in-excel/
December 24th, 2011 at 6:55 am
Hi!!
This is Ramki. Require your help to fix my concern.
Need a formula to return multiple values while using a double look up formula (Index/Match).