Hello
I have a calculated formula in a column on a sharepoint list which takes two date entries and calculates the number of days between them. Another value then minuses a number of days from the first calculation.
For some reason, this calculation doesn't work on some date ranges but does on others.
The formula in question (which I did not write and looks overly complicated for what I believe it should be achiving) is:
=IF(AND((WEEKDAY([Approved],2))<(WEEKDAY([Added],2)),((WEEKDAY([Added],2))-(WEEKDAY([Approved],2)))>1),(((DATEDIF([Added],[Approved],"D")))-(FLOOR((DATEDIF([Added],[Approved],"D")+1)/7,1)*2)-2),(((DATEDIF([Added],[Approved],"D")))-(FLOOR((DATEDIF([Added],[Approved],"D")+1)/7,1)*2)-[On Hold]))
The column 'Added' and 'Approved' contains a date in the format dd/mm/yyyy.
The column 'On Hold' contains a number.
The formula should simply work out the days between Added and Approved (excluding the weekend) then minus the value in the On Hold column. This seems work fine most of the time except when certain date ranges are crossed.
For example if the Added column contains 26/06/2012, Approved contains 03/07/2012 and On Hold contains 0 then the days between the two dates comes back as 5 which is correct. Using the same values but changing On Hold to 2 the days between comes back as 3. Also correct. If I put the Added column date back to say 15/06/2012 leaving the Approved column as 03/07/2012 and putting On Hold to 0, 12 is returned which once again is correct.
However, if I have Added as 15/06/2012, Approved as 03/07/2012 but change On Hold to 2, 12 is still returned however this should be 10 (date between 15 June and 3rd July minus 2 equals 10 excluding weekends).
I'm not really not sure what is causing this, it seems like the formula works fine most of the times except when the date passes across certain dates? I don't think the system is getting confused with the date format like dd/mm or mm/dd.
Perhaps there is an easier way to write this to achive the result I'm looking for.
I am using WSS3.
Any help would be much appreciated.
I have a calculated formula in a column on a sharepoint list which takes two date entries and calculates the number of days between them. Another value then minuses a number of days from the first calculation.
For some reason, this calculation doesn't work on some date ranges but does on others.
The formula in question (which I did not write and looks overly complicated for what I believe it should be achiving) is:
=IF(AND((WEEKDAY([Approved],2))<(WEEKDAY([Added],2)),((WEEKDAY([Added],2))-(WEEKDAY([Approved],2)))>1),(((DATEDIF([Added],[Approved],"D")))-(FLOOR((DATEDIF([Added],[Approved],"D")+1)/7,1)*2)-2),(((DATEDIF([Added],[Approved],"D")))-(FLOOR((DATEDIF([Added],[Approved],"D")+1)/7,1)*2)-[On Hold]))
The column 'Added' and 'Approved' contains a date in the format dd/mm/yyyy.
The column 'On Hold' contains a number.
The formula should simply work out the days between Added and Approved (excluding the weekend) then minus the value in the On Hold column. This seems work fine most of the time except when certain date ranges are crossed.
For example if the Added column contains 26/06/2012, Approved contains 03/07/2012 and On Hold contains 0 then the days between the two dates comes back as 5 which is correct. Using the same values but changing On Hold to 2 the days between comes back as 3. Also correct. If I put the Added column date back to say 15/06/2012 leaving the Approved column as 03/07/2012 and putting On Hold to 0, 12 is returned which once again is correct.
However, if I have Added as 15/06/2012, Approved as 03/07/2012 but change On Hold to 2, 12 is still returned however this should be 10 (date between 15 June and 3rd July minus 2 equals 10 excluding weekends).
I'm not really not sure what is causing this, it seems like the formula works fine most of the times except when the date passes across certain dates? I don't think the system is getting confused with the date format like dd/mm or mm/dd.
Perhaps there is an easier way to write this to achive the result I'm looking for.
I am using WSS3.
Any help would be much appreciated.