Sum the days between two tasks

B

Brad Harris

MS Project 2007 Pro
How do I sum the dyas between two tasks. Pick any two tasks on a splan and
get the number of days between the start of the two?
 
J

JulieS

Hello Brad,

Sorry, you cannot do math in project referencing different project
tasks. You can calculate the difference between dates on a single
task, (Start, Start1, etc) but not automatically between tasks. It
may be possible through VBA, but perhaps if you describe why you
need this we can suggest an alternative.

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
 
J

Jim Aksel

You are going to need to use some VBA to get to the solution.
You will need a combination of the functions ProjDateDiff(), ProjDateSub(),
and ProjDurValue().

However, you are going to have to feed these functions the start (or finish)
dates of the separate tasks in question.

What are you trying to accomplish? Might it be easier to indent the two
tasks under a summary task and then examine that duration?
--
If this post was helpful, please consider rating it.

Jim Aksel, MVP

Check out my blog for more information:
http://www.msprojectblog.com
 
B

Brad Harris

Thanks,

The user wants to click on a task and click on another task and look at the
relationship between the two in days. I was telling him we could probably
setup a formula looking at the dates. What would the formula look like?
Start1-Start2 how is it exactly?
 
J

JulieS

Brad,

As I noted before, I don't believe you can make this happen through
a simple formula . You'll have to capture the details on the
"clicked" task through VBA, capture the details on the other
"clicked" task and then through code determine the differences
between the two values.

You can calculate differences between dates on the _same_ task
through functions such as ProjDateDiff() as Jim said but those
relatively simple functions will not work to compare dates between
different tasks. For help on the Project Functions, search help in
MS Project on "Project functions".

If you are interested in pursuing the possibilities through VBA and
have some skill with VBA, I suggest posting your question including
details such as -- what do you envision triggering the code, is
displaying the information in a message box sufficient, and other
details to the project developer newsgroup. Someone there can
perhaps get you started in the correct direction with the code.

Julie
 

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