Is there a simpler way to complete this task?
I want to look up a value and a date in a list and return the date if it matches or is within 5 days of the original date.
The only way I've been able to do this so far is to create a helper key (A1) and look up the helper-key in a helper-key list (F:F), and add an IFERROR to look it up again but add 1 and so on.
Example:
A B C D
1 table1_ky table1_id table1_dt vlookup
2 99941275 999 1/1/2013 1/3/2013
G H I
1 table2_ky table2_id table2_dt
2 99941277 999 1/3/2013
Formula in D2:
=IFERROR(VLOOKUP(TEXT(A2,0),F:H,3,0),IFERROR(VLOOKUP(TEXT(A2+1,0),F:H,3,0),IFERROR(VLOOKUP(TEXT(A2+2,0),F:H,3,0),"no")))
I want to be able to make the number of "+1"s variable so I can change the date range to 5, 10, 30 etc. without having to use up to 30 IFERROR statements.
Is there a function(s) in Excel that can do something like this?
I'd like to avoid using VBA if possible.