Date Formulas

M

MikeM

First I appreciate all of the tips I have picked up here along the way...been a lurker for quite some time.

Now the real deal, I'm trying to write a formula to generate a day calculation based on the finish date of a task and the start date of "task 1". Basically, imagine task one as being a contract award date in its finish field and I want all of the subsequent tasks to calculate their finish dates into the number of days since task ones finish...a "days after contract award" field basically

Any help

Thanks, Mike
 
R

Rod Gill

Hi,

A formula in Project can only access data for the task, so reading the
finish date of task 1 can't be done. You can solve this by writing a VBA
macro to do what you want or...

Insert the column Date1
Copy the Finish date of Task1 to all other tasks (use fill down to this
fast)
Now create a formula to calculate the date difference between the finish
field and Date1 field.

In formula builder there are a number of date calculation options for you to
use.

--
For VBA posts, please use the public.project.developer group.
For any version of Project use public.project
For any version of Project Server use public. project.server

Rod Gill
Project MVP
For Microsoft Project companion projects, best practices and Project VBA
development services
visit www.projectlearning.com/
MikeM said:
First I appreciate all of the tips I have picked up here along the
way...been a lurker for quite some time.
Now the real deal, I'm trying to write a formula to generate a day
calculation based on the finish date of a task and the start date of "task
1". Basically, imagine task one as being a contract award date in its
finish field and I want all of the subsequent tasks to calculate their
finish dates into the number of days since task ones finish...a "days after
contract award" field basically.
 
J

JackD

Since a task formula only has access to information about itself (ie: you
can't directly compare to other tasks) you have only a few ways to do this.

1) Use a project level date field such as Status Date or even perhaps you
could put the date into one of the project level text fields (Author or
Subject perhaps?) then that one value can be used for all tasks.

2) Copy and paste the task one date into a custom field (date5 for example)
for all the tasks. Then use date5 in your formula

3) Use VBA. It will allow you to reference other tasks in your calculations.
However it requires that you run the macro whenever you want to update.

4) A variation on 2 - use the copy, paste special/link into date5 or
similar. This way an update to the task one date will be proliferated to all
tasks (I don't recommend this approach. That sort of linking can be
problematic)

-Jack



MikeM said:
First I appreciate all of the tips I have picked up here along the
way...been a lurker for quite some time.
Now the real deal, I'm trying to write a formula to generate a day
calculation based on the finish date of a task and the start date of "task
1". Basically, imagine task one as being a contract award date in its
finish field and I want all of the subsequent tasks to calculate their
finish dates into the number of days since task ones finish...a "days after
contract award" field basically.
 
G

Gérard Ducouret

Hello Mike,

Did you fill all the rows of [Date1] field with a true date ?

Gérard Ducouret

MikeM said:
I think I'm with you. I've added a new "date1" field, so would something
like "ProjDateDiff([Date1],[Finish],Task Calendar)" give me the info I need?
I keep getting an error in the cells. Sorry if I'm dense but I'm still
fairly new to project.
 
J

JackD

And do you actually have a calendar called "Task Calendar"? Try putting
quotes around it.

-Jack


Gérard Ducouret said:
Hello Mike,

Did you fill all the rows of [Date1] field with a true date ?

Gérard Ducouret

MikeM said:
I think I'm with you. I've added a new "date1" field, so would something
like "ProjDateDiff([Date1],[Finish],Task Calendar)" give me the info I need?
I keep getting an error in the cells. Sorry if I'm dense but I'm still
fairly new to project.
 

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