So I have a user sheet which looks up some values from sheet2 where the dates fall between a certain range. Currently this works independant of the year.
The code is as follows
=IFERROR(IF($A3<>"",INDEX(Sheet2!$A$3:$A$20000,MATCH(User_Sheet!$B$1,IF((Sheet2!$A$3:$A$20000>User_Sheet!$A3)*(TEXT(Sheet2!$K$3:$K$20000,"dd/mm")+0>=TEXT(User_Sheet!$D$1,"dd/mm")+0)*(TEXT(Sheet2!$K$3:$K$20000,"dd/mm")+0"<"TEXT(User_Sheet!$E$1,"dd/mm")+0),Sheet2!$E$3:$E$20000),0)),""),"")
<TEXT(USER_SHEET!$E$1,"DD p code]< mm?)+0),Sheet2!$E$3:$E$20000),0)),??),??)[ code]<TEXT(USER_SHEET!$E$1,?DD mm?)+0),Sheet2!$E$3:$E$20000),0)),??),??)<TEXT(USER_SHEET!$E$1,?DD>
This is fine if I'm looking at dates between for example 01/05/2011 and 10/05/2011. It returns all the relevant data for all years.
However a problem occurs when the date range crosses a year, for example if I wanted to return all values between 25/12/2010 and 05/01/2011.
Any idea how to solve this issue?
The code is as follows
=IFERROR(IF($A3<>"",INDEX(Sheet2!$A$3:$A$20000,MATCH(User_Sheet!$B$1,IF((Sheet2!$A$3:$A$20000>User_Sheet!$A3)*(TEXT(Sheet2!$K$3:$K$20000,"dd/mm")+0>=TEXT(User_Sheet!$D$1,"dd/mm")+0)*(TEXT(Sheet2!$K$3:$K$20000,"dd/mm")+0"<"TEXT(User_Sheet!$E$1,"dd/mm")+0),Sheet2!$E$3:$E$20000),0)),""),"")
<TEXT(USER_SHEET!$E$1,"DD p code]< mm?)+0),Sheet2!$E$3:$E$20000),0)),??),??)[ code]<TEXT(USER_SHEET!$E$1,?DD mm?)+0),Sheet2!$E$3:$E$20000),0)),??),??)<TEXT(USER_SHEET!$E$1,?DD>
This is fine if I'm looking at dates between for example 01/05/2011 and 10/05/2011. It returns all the relevant data for all years.
However a problem occurs when the date range crosses a year, for example if I wanted to return all values between 25/12/2010 and 05/01/2011.
Any idea how to solve this issue?
Last edited: