formula

K

kym

Hello agai
I am trying to enter a formula in project but I am going in cycles
question I. Where do I enter it.
question 2. Can I make it applicable for the whole colum
All I want to enter is eg: number 1 (field name)* number 5(field name

Please someone help me before I go nuts.
 
G

Gérard Ducouret

Hello Kym,
I expect that you have Project version 2000 or following, because calculated
field didn't exist in the previous version.
You can enter a formula in any custom field of MS Project 2000+ : Number1 to
Number 20, Text1 to Text30...etc
A formula is always applicable to the whole column. There is an option to
make it applicable to the Summary tasks.

Insert a column : Number1 for ex.
Right click on its caption, select Customize Fields...
Click the Formula button
With several clicks on the appropriate buttons, write the formula:
[Number1] * [Number5]

Hope this helps,

Gérard Ducouret
 
K

kym

Thanks Gerard but I'm working in project 98. Maybe that is why I carnt get the formula to work
Could you tell me what to do in the 98 version pleas

----- Gérard Ducouret wrote: ----

Hello Kym
I expect that you have Project version 2000 or following, because calculate
field didn't exist in the previous version
You can enter a formula in any custom field of MS Project 2000+ : Number1 t
Number 20, Text1 to Text30...et
A formula is always applicable to the whole column. There is an option t
make it applicable to the Summary tasks

Insert a column : Number1 for ex
Right click on its caption, select Customize Fields..
Click the Formula butto
With several clicks on the appropriate buttons, write the formula
[Number1] * [Number5

Hope this helps

Gérard Ducoure
 
S

Steve House

I may be wrong and no longer have 98 installed to verify this, but as I
recall you CAN'T do it in Project 98. User defined calculated fields are a
feature that was first introduced in Project 2000. So what can you do in
98? Upgrade your software to something more current - if the cost of 2003
is an issue, look for a copy of 2000 or later on eBay. 98 came out over 6
years ago - that is a very very long time in software evolution terms and
there comes a time when you simply must set it aside and move on. The
changes from 98 to 2000 are very signifigant, not just the user-defined
fields, and make the move totally justifiable.




kym said:
Thanks Gerard but I'm working in project 98. Maybe that is why I carnt get the formula to work.
Could you tell me what to do in the 98 version please

----- Gérard Ducouret wrote: -----

Hello Kym,
I expect that you have Project version 2000 or following, because calculated
field didn't exist in the previous version.
You can enter a formula in any custom field of MS Project 2000+ : Number1 to
Number 20, Text1 to Text30...etc
A formula is always applicable to the whole column. There is an option to
make it applicable to the Summary tasks.

Insert a column : Number1 for ex.
Right click on its caption, select Customize Fields...
Click the Formula button
With several clicks on the appropriate buttons, write the formula:
[Number1] * [Number5]

Hope this helps,

Gérard Ducouret


kym said:
Hello again
I am trying to enter a formula in project but I am going in cycles.
question I. Where do I enter it.
question 2. Can I make it applicable for the whole colume
All I want to enter is eg: number 1 (field name)* number 5(field name)
 
J

John

Kym,
Steve is exactly right about calculated fields not being introduced
until Project 2000. However you don't have to upgrade to get what you
want. A simple VBA macro will do the trick. You didn't specify where you
want the result, this code puts the calculated value in field Number2.
Sub CalculateValue()
For Each t In ActiveProject.Tasks
If Not t Is Nothing Then
t.Number2 = t.Number1 * t.Number5
End If
Next t
End Sub

Hope this helps.
John
 
K

kym

Hi Joh
Thank you for your help.Can I have some more please :
I entered (actually copy&pasted) the formula below and changed the Number2 to ActualDuration as that is where I want the calculation to show, but I'm not getting any results
Is * multipy and / divide in Project 98?
----- John wrote: ----


Kym
Steve is exactly right about calculated fields not being introduced
until Project 2000. However you don't have to upgrade to get what you
want. A simple VBA macro will do the trick. You didn't specify where you
want the result, this code puts the calculated value in field Number2
Sub CalculateValue(
For Each t In ActiveProject.Task
If Not t Is Nothing The
t.Number2 = t.Number1 * t.Number
End I
Next
End Su

Hope this helps
Joh
 
K

kym

John something is happening. It is calulating into the task usage view and I was looking in the grant chart vie
I am not getting the correct calculation but I am getting something. It seems to be multiplying by 2 and it dosnt matter if I change your macro to / where you have * it still multiplys in 2. ie: 50 units and I get 100 hrs, 32000units and I get 64000hrs.
I would like it to take (I had to change them a little) number5 divide by number4 divide by 30.and put the results in ActualDuration
 
J

John

Kym,
Sure, help is what we do. First, the ActualDuration field is read only
for summary tasks so the code needs to be modified to skip around those.
Second, Project calculates time related fields (e.g. duration) in
minutes. Therefore, the values in the Number1 and Number5 fields need to
be in minutes, or if they are entered as "days" the code will have to
multiply by 480, the number of minutes in a standard 8 hour day.
Finally, yes "*" is multiply and "/" is divide.

Here is the modified code:
Sub CalculateValue1()
For Each t In ActiveProject.Tasks
If Not t Is Nothing And t.Summary = False Then
t.ActualDuration = t.Number1 * t.Number5
[or, if the values in the number fields are in days]
t.ActualDuration = (t.Number1 * t.Number5) * 480
End If
Next t
End Sub

Although the latest versions of Project add new features, some users
don't need the added capability and/or can't afford to upgrade. From my
experience, any version of Project can be enhanced through the use of
VBA to do whatever is needed.

Hope this helps.

John
 

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