BLOGS BY TOPIC
BLOGS BY AUTHOR
BLOGS BY YEAR
Have you ever been frustrated when you can't find a suitable field for entering the data you want in a Microsoft Project plan? Well why not customise your own field and enter anything from simple text, to drop down lists, to complex calculations and even graphical indicators!
- Custom Fields in Microsoft Project
- Creating Drop Down Lists with Custom Fields
- Creating Calculated Custom Fields (this blog)
- Using Functions in Custom Fields
- Custom Fields and Summary Tasks
- Using Graphical Indicators in Custom Fields
Posted by Andrew Gould on 01 August 2011
You need a minimum screen resolution of about 700 pixels width to see our blogs. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.
Creating Calculated Custom Fields
So far in this series of articles we have seen how to create custom fields that allow you to type in or select a piece of data for tasks or resources. This article will show you how to create a custom field that will calculate a value by itself as you update the information in your project plan.
To begin with we're going to create a simple calculation that will work out whether or not we've overspent on a task. The fields will work like so:
This example actually involves two custom fields, as described below.
The fields involved in this example are:
- Task Budget - This is a simple custom field that allows us to enter a cost that sets the budget for the task. The field is a Task field, and the data type is Cost.
- Actual Cost - This is a built-in field in Microsoft Project which calculates how much has actually been spent on a task.
- Spend Variance - This is our calculated custom field. It simply subtracts the Actual Cost from the Task Budget to work out the variance.
Creating a Calculated Field
To start creating our calculated field we'll need to customise a Cost field. Set it up like so:
Set up the field with these basic settings, as described below.
- Choose to customise a Task field.
- Change the data type to Cost.
- Rename the field by clicking the Rename... button.
- Click this button to create the calculation.
Creating a Simple Calculation
When you click the Formula... button you will see a new dialog box where you can create your calculation or expression.
Use this dialog box to create calculations. You can either type the calculation in manually, or use the relevant buttons to insert field names and functions.
Our calculation needs to subtract the value of the Actual Cost field from the value of our custom Task Budget field. The easiest way to do this is as follows:
- Using the dialog box shown above, click: Field -> Cost -> Custom Cost -> Task Budget (Cost1)
- Type in a minus symbol (-), or click the relevant button on the dialog box.
- Click: Field -> Cost -> Actual Cost
The end result of doing this should resemble the example shown below:
The finished formula.
Click OK to finish creating the formula. If this is the first time you have created a formula for that custom field you will see a message warning you that any existing information in the field will be deleted. Click OK again to finally finish creating your formula.
If you see this warning message, don't worry. Just click OK to finish creating your formula.
Using a Calculated Field
You can insert a calculated field into a table, just as for any other field. The main difference between a calculated field and other custom fields is that you can't type any information into it - instead, the values for this field will be calculated automatically as you enter data into other fields.
|When we update the Actual Cost field...||...the Spend Variance is calculated automatically.|
Although you can do some quite interesting things with the simple type of calculation we've seen in this article, you can do even more interesting (and useful!) things when you start to use functions in your calculations. Read the next article in this series to find out how.