I'm banging my head with this issue and help would be highly appreciated.
I have some data gathered monthly and to sum it up I need to discover if midweek holidays are included within a range of dates. For simplicity the relevant data on the sheet is structured like this:
What I want to know is does the the array listed in column H have any of the numbers listed in column D with the special rule there must be one consecutive datevalue before and 2 after (to simplify, if the number we are comparing is 2, then an array of 1, 2, 3, 4 would give TRUE).
The two formulas I've tried to use in column I are:
=IF(AND(ISNUMBER(MATCH(D2-1; $H$2:$H$1000; 0)); OR(ISNUMBER(MATCH(D2+2; $H$2:$H$1000; 0)); ISNUMBER(MATCH(D2+3; $H$2:$H$1000; 0)))); TRUE; FALSE)
and
=IF(SUMPRODUCT(--(ISNUMBER(MATCH(D2:D1000-1; $H$2:$H$1000; 0))); --(ISNUMBER(MATCH(D2:D1000+2; $H$2:$H$1000; 0))); --(ISNUMBER(MATCH(D2:D1000+3; $H$2:$H$1000; 0)))) > 0; TRUE; FALSE)
but both give FAIL for every row meaning, that they are not compiled right. Because of localization I use semicolon as the separator inside formulas. Could anyone help me out with this one because my head is really starting to hurt.
I have some data gathered monthly and to sum it up I need to discover if midweek holidays are included within a range of dates. For simplicity the relevant data on the sheet is structured like this:
D: Dates I'm comparing | H: Date range | I: Expected output values |
---|---|---|
44536 | 44531; 44532; 44533; 44537; 44538; 44539; 44540 | FALSE |
44556 | 44531; 44532; 44533; 44537; 44538; 44539; 44540; 44550; 44551; 44552; 44553 | FALSE |
44559 | 44531; 44532; 44533; 44537; 44538; 44539; 44540; 44550; 44551; 44552; 44553; 44557; 44558; 44559; 44560; 44561 | TRUE |
What I want to know is does the the array listed in column H have any of the numbers listed in column D with the special rule there must be one consecutive datevalue before and 2 after (to simplify, if the number we are comparing is 2, then an array of 1, 2, 3, 4 would give TRUE).
The two formulas I've tried to use in column I are:
=IF(AND(ISNUMBER(MATCH(D2-1; $H$2:$H$1000; 0)); OR(ISNUMBER(MATCH(D2+2; $H$2:$H$1000; 0)); ISNUMBER(MATCH(D2+3; $H$2:$H$1000; 0)))); TRUE; FALSE)
and
=IF(SUMPRODUCT(--(ISNUMBER(MATCH(D2:D1000-1; $H$2:$H$1000; 0))); --(ISNUMBER(MATCH(D2:D1000+2; $H$2:$H$1000; 0))); --(ISNUMBER(MATCH(D2:D1000+3; $H$2:$H$1000; 0)))) > 0; TRUE; FALSE)
but both give FAIL for every row meaning, that they are not compiled right. Because of localization I use semicolon as the separator inside formulas. Could anyone help me out with this one because my head is really starting to hurt.