#1
|
|||
|
|||
Using DateDif Function
Hi
I am struggling with a DateDif function. I want to be able to identify those tasks that are scheduled to finish within 3 days of the current date. Here is what I have tried so far: IIf(Date()-[Finish]>"0" And Date()-[Finish]<="3","TRUE","FALSE") IIf(DateDif("d",[Finish],Date())>"0" AND DateDif("d",[Finish],Date())<="3","TRUE","FALSE") However neither works. I am sure I am close but cant see the issue. Any help appreciated. Thanks Tony |
#2
|
|||
|
|||
Hi Tony,
The Project function is DateDiff and I would use [Current Date] instead of Date(). Try: IIf(DateDiff("d",[Finish],[Current Date])>0 And DateDiff("d",[Finish],[Current Date])<=3,True,False) in a flag field |
#3
|
|||
|
|||
Hi Julie
Many thanks for your prompt response (yes I did spell the Function name wrong :-)). I ended up using this formula in the end but will also try your solution: IIf([Finish]>Date(),IIf([Finish]-Date()<=3,"TRUE","FALSE"),"NA") Edit: I modified your solution in an attempt to ignore those tasks that were complete but the edit does not work, any ideas? IIf([Status]="Complete","",IIf(DateDiff("d",[Finish],[Current Date])>0 And DateDiff("d",[Finish],[Current Date])<=3,True,False)) Thanks Tony |
#4
|
|||
|
|||
The status field is a number field to the best of my knowledge. Try using % Complete. The formula below works in a Text field (not a flag field)
IIf([% Complete]=100," ",IIf(DateDiff("d",[Finish],[Current Date])>0 And DateDiff("d",[Finish],[Current Date])<=3,True,False)) |
#5
|
|||
|
|||
Hi Julie
Thanks for the feedback. Unfortunately this formula does not appear to work. For example I have a task that is due to finish on 19 March and it is not being flagged at all. Edit: Sorted - needed the True and False in quotes then it works fine. Thanks Julie. Tony |
#6
|
|||
|
|||
Great. Glad you have it worked out. I think when I tested I just saw the -1 and 0 and forgot to switch it out.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Creating a graph for Future Value function (FV function) | bmoody | Excel | 2 | 11-06-2013 10:52 AM |
IF function | msheyworth | Excel | 2 | 03-28-2013 02:15 AM |
Sum Function | teza2k06 | Excel | 3 | 02-06-2013 08:29 AM |
Help with DATEDIF Formula | caz46 | Excel | 7 | 01-12-2012 08:46 AM |
if function help | jim831 | Excel | 2 | 10-29-2010 07:06 PM |