Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-13-2014, 06:32 AM
OTPM OTPM is offline Using DateDif Function Windows 7 32bit Using DateDif Function Office 2010 32bit
Expert
Using DateDif Function
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default 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
Reply With Quote
  #2  
Old 03-13-2014, 10:14 AM
JulieS JulieS is offline Using DateDif Function Windows 7 64bit Using DateDif Function Office 2013
Expert
 
Join Date: Dec 2011
Location: New England
Posts: 1,693
JulieS will become famous soon enough
Default

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
Reply With Quote
  #3  
Old 03-14-2014, 01:26 AM
OTPM OTPM is offline Using DateDif Function Windows 7 32bit Using DateDif Function Office 2010 32bit
Expert
Using DateDif Function
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default

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
Reply With Quote
  #4  
Old 03-14-2014, 08:47 AM
JulieS JulieS is offline Using DateDif Function Windows 7 64bit Using DateDif Function Office 2013
Expert
 
Join Date: Dec 2011
Location: New England
Posts: 1,693
JulieS will become famous soon enough
Default

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))
Reply With Quote
  #5  
Old 03-17-2014, 02:17 AM
OTPM OTPM is offline Using DateDif Function Windows 7 32bit Using DateDif Function Office 2010 32bit
Expert
Using DateDif Function
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default

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
Reply With Quote
  #6  
Old 03-17-2014, 05:16 AM
JulieS JulieS is offline Using DateDif Function Windows 7 64bit Using DateDif Function Office 2013
Expert
 
Join Date: Dec 2011
Location: New England
Posts: 1,693
JulieS will become famous soon enough
Default

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.
Reply With Quote
Reply



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
Using DateDif Function IF function msheyworth Excel 2 03-28-2013 02:15 AM
Using DateDif Function Sum Function teza2k06 Excel 3 02-06-2013 08:29 AM
Using DateDif Function 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

Other Forums: Access Forums

All times are GMT -7. The time now is 01:40 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft