date difference

G

Greg

I'm trying to calculate the difference between finish date and deadline.
What field name (Number1) or type should I use? in the customize fields
formula, can I use [deadline]-[finish]?
 
J

JulieS

Hello Greg,

You could use either a text field (Text1, Text2 for example) or a
spare number field (Number1, Number2, etc.) for the formula. I like
the Text field formula below because I append the word "days" to show
the calculation is in days.

For a text field use the formula:
DateDiff("d",[Finish],[Deadline]) & " days"

For a number field use the formula:
DateDiff("d",[Finish],[Deadline])

I hope this helps. Let us know how you get along.

Julie
Project MVP

Visit http://project.mvps.org/ for the FAQs and additional information
about Microsoft Project
 
G

Greg

This is great information. I like just subtracting the two rather than using
DateDiff because the function take the ABS of the difference.

Next question how do I get rid of the "#Error" when the deadline is NA?

JulieS said:
Hello Greg,

You could use either a text field (Text1, Text2 for example) or a
spare number field (Number1, Number2, etc.) for the formula. I like
the Text field formula below because I append the word "days" to show
the calculation is in days.

For a text field use the formula:
DateDiff("d",[Finish],[Deadline]) & " days"

For a number field use the formula:
DateDiff("d",[Finish],[Deadline])

I hope this helps. Let us know how you get along.

Julie
Project MVP

Visit http://project.mvps.org/ for the FAQs and additional information
about Microsoft Project

Greg said:
I'm trying to calculate the difference between finish date and
deadline.
What field name (Number1) or type should I use? in the customize
fields
formula, can I use [deadline]-[finish]?
 
J

JulieS

Hello Greg,

You need to test for the Deadline being "NA". The formula below can
be used in the text field:

IIf([Deadline]=ProjDateValue("NA")," ",[Deadline]-[Finish] & " days")

If a deadline has not been added to the task, the field will be blank.
If a deadline has been added, it will calculate the difference between
the deadline date and finish date and append the word "days".

I hope this helps. Let us know how you get along.

Julie
Project MVP

Visit http://project.mvps.org/ for the FAQs and additional information
about Microsoft Project

Greg said:
This is great information. I like just subtracting the two rather
than using
DateDiff because the function take the ABS of the difference.

Next question how do I get rid of the "#Error" when the deadline is
NA?

JulieS said:
Hello Greg,

You could use either a text field (Text1, Text2 for example) or a
spare number field (Number1, Number2, etc.) for the formula. I
like
the Text field formula below because I append the word "days" to
show
the calculation is in days.

For a text field use the formula:
DateDiff("d",[Finish],[Deadline]) & " days"

For a number field use the formula:
DateDiff("d",[Finish],[Deadline])

I hope this helps. Let us know how you get along.

Julie
Project MVP

Visit http://project.mvps.org/ for the FAQs and additional
information
about Microsoft Project

Greg said:
I'm trying to calculate the difference between finish date and
deadline.
What field name (Number1) or type should I use? in the customize
fields
formula, can I use [deadline]-[finish]?
 
J

Jan De Messemaeker

Hi Julie,

Why do you exclude the possibility to use a duration field? That
automatically shows whatever is your preferred duration uinit (days,
hours...)
Greetings,

--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availability check:
http://users.online.be/prom-ade/Calendar.pdf
JulieS said:
Hello Greg,

You could use either a text field (Text1, Text2 for example) or a spare
number field (Number1, Number2, etc.) for the formula. I like the Text
field formula below because I append the word "days" to show the
calculation is in days.

For a text field use the formula:
DateDiff("d",[Finish],[Deadline]) & " days"

For a number field use the formula:
DateDiff("d",[Finish],[Deadline])

I hope this helps. Let us know how you get along.

Julie
Project MVP

Visit http://project.mvps.org/ for the FAQs and additional information
about Microsoft Project

Greg said:
I'm trying to calculate the difference between finish date and deadline.
What field name (Number1) or type should I use? in the customize fields
formula, can I use [deadline]-[finish]?
 
J

JulieS

Jan De Messemaeker said:
Hi Julie,

Why do you exclude the possibility to use a duration field? <snip>

Hello Jan,

Just sheer stupidity, I think :)

Thanks so much for the reminder.

Best,
Julie
 
J

JulieS

Greg,

Sorry if this is a duplicate. I just noticed that the reply below is
not showing in the newsgroup being displayed through the web.
----------------------------------------------------------------
You need to test for the Deadline being "NA". The formula below can
be used in the text field:

IIf([Deadline]=ProjDateValue("NA")," ",[Deadline]-[Finish] & "
days")

If a deadline has not been added to the task, the field will be
blank. If a deadline has been added, it will calculate the
difference between the deadline date and finish date and append the
word "days".

I hope this helps. Let us know how you get along.

Julie
Project MVP

Visit http://project.mvps.org/ for the FAQs and additional
information about Microsoft Project

Greg said:
This is great information. I like just subtracting the two rather
than using
DateDiff because the function take the ABS of the difference.

Next question how do I get rid of the "#Error" when the deadline is
NA?

JulieS said:
Hello Greg,

You could use either a text field (Text1, Text2 for example) or a
spare number field (Number1, Number2, etc.) for the formula. I
like
the Text field formula below because I append the word "days" to
show
the calculation is in days.

For a text field use the formula:
DateDiff("d",[Finish],[Deadline]) & " days"

For a number field use the formula:
DateDiff("d",[Finish],[Deadline])

I hope this helps. Let us know how you get along.

Julie
Project MVP

Visit http://project.mvps.org/ for the FAQs and additional
information
about Microsoft Project

I'm trying to calculate the difference between finish date and
deadline.
What field name (Number1) or type should I use? in the
customize
fields
formula, can I use [deadline]-[finish]?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top