P
Pete Rooney
Good afternoon,
Don't know if anyone has looked at this on Chip Pearson's website, but try
as I might, I can't get the the more complex variant of the formula to work,
the one that allows you to specify two lists to exclude - a generic 1, 2, 3
list to represent Sunday, Monday, Tuesday etc and an additional list for any
other specific dates to be excluded. You can hard code the 1,2 3 etc into the
formula (Example 1) or make it refer to a range of up to 7 cells that can
contain these numbers (Example 2), but everything I try returns #N/A!
Here's what I have (entered as array formulae)
Example
=IF(OR(StartDate<=0,EndDate<=0,StartDate<=EndDate,ISNUMBER(StartDate)=FALSE,ISNUMBER(EndDate)=FALSE),NA(),SUM(IF(ISERROR(MATCH(WEEKDAY(ROW(INDIRECT(StartDate&":"&EndDate))),{1,6,7},0)),IF(ISERROR(MATCH(ROW(INDIRECT(StartDate&":"&EndDate)),Holidays,0)),1,0)),0))
Example
=IF(OR(StartDate<=0,EndDate<=0,StartDate<=EndDate,ISNUMBER(StartDate)=FALSE,ISNUMBER(EndDate)=FALSE),NA(),SUM(IF(ISERROR(MATCH(WEEKDAY(ROW(INDIRECT(StartDate&":"&EndDate))),ExcludeDaysOfWeek,0)),IF(ISERROR(MATCH(ROW(INDIRECT(StartDate&":"&EndDate)),Holidays,0)),1,0)),0))
StartDate (B5) contains 01/08/2008, EndDate (C5) contains 31/08/2008
ExcludeDaysOfWeek (H5:H11) contains 1, 6 and 7 in H5, H6 and H7
Holidays (J5:J11) contains 02/08/2008 and 03/08/2008 in J5 and J6
Please can anyone help - this will be really useful to me, but I just can't
figure out what I'm doing wrong!
Thanks in advance
Pete
Don't know if anyone has looked at this on Chip Pearson's website, but try
as I might, I can't get the the more complex variant of the formula to work,
the one that allows you to specify two lists to exclude - a generic 1, 2, 3
list to represent Sunday, Monday, Tuesday etc and an additional list for any
other specific dates to be excluded. You can hard code the 1,2 3 etc into the
formula (Example 1) or make it refer to a range of up to 7 cells that can
contain these numbers (Example 2), but everything I try returns #N/A!
Here's what I have (entered as array formulae)
Example
=IF(OR(StartDate<=0,EndDate<=0,StartDate<=EndDate,ISNUMBER(StartDate)=FALSE,ISNUMBER(EndDate)=FALSE),NA(),SUM(IF(ISERROR(MATCH(WEEKDAY(ROW(INDIRECT(StartDate&":"&EndDate))),{1,6,7},0)),IF(ISERROR(MATCH(ROW(INDIRECT(StartDate&":"&EndDate)),Holidays,0)),1,0)),0))
Example
=IF(OR(StartDate<=0,EndDate<=0,StartDate<=EndDate,ISNUMBER(StartDate)=FALSE,ISNUMBER(EndDate)=FALSE),NA(),SUM(IF(ISERROR(MATCH(WEEKDAY(ROW(INDIRECT(StartDate&":"&EndDate))),ExcludeDaysOfWeek,0)),IF(ISERROR(MATCH(ROW(INDIRECT(StartDate&":"&EndDate)),Holidays,0)),1,0)),0))
StartDate (B5) contains 01/08/2008, EndDate (C5) contains 31/08/2008
ExcludeDaysOfWeek (H5:H11) contains 1, 6 and 7 in H5, H6 and H7
Holidays (J5:J11) contains 02/08/2008 and 03/08/2008 in J5 and J6
Please can anyone help - this will be really useful to me, but I just can't
figure out what I'm doing wrong!
Thanks in advance
Pete