Microsoft Office Tutorials and References
In Depth Information
C R E A T I N G A C A L C U L A T E D F I E L D
To create a column, do the following:
1. As you’ve done before, go to the Column section of the List Settings page for the list,
and click Create Column (I am assuming you’ve been following along from the previous
chapter. For more details about creating columns, see Chapter 6.).
2. Because the original Full Name field has been deleted, that name is available for use in
this list, so you can name the new field Full Name.
3. For the data type, choose Calculated, which is at the bottom of the list. Once Calculated
is selected, the Additional Column Settings section will change to reflect the needs of a
calculated data type.
4. For the description, you can use the Combined First Name and Last Name fields. Always
describe any calculated fields so that you will be reminded later what the field was
intended to do.
Because calculated formulas in lists often refer to values in other fields of a list, there is a
convenient Insert Column field populated by the field names of the list right next to the
roomy Formula box. We are going to use a formula to concatenate (string together two or
more text values) the data in the First Name and Last Name fields to create the value of
the Full Name field. This is a common text calculation. You can explore the help files for
more formulas, because this calculated field can do all kinds of functions, even
trigonometry if necessary.
5. To do the concatenation (see Figure 7.27), click in the Formula box. The formula for
concatenating fields is as follows:
[First Name]&” “&[Last Name]
Normally, like Excel, SharePoint formulas start with an equal sign. However, because you
are going to use a box specifically for formulas to create the field, the equal sign is
understood; you don’t need to type it, but SharePoint will add it later. Field names are always
in brackets, the ampersands (&) indicate the concatenation, and you are inserting a space
(which has to be in quotes) between the two words. If you don’t insert the space, the first
and last names will run together into one word.
6. You can choose the data type that will be returned by the formula. A single line of text is
good for our purposes, but, depending on the situation, you could also choose something
like date and time or even Yes/No.
7. Be sure the Add To Default View box is selected, and click OK.
Back on the List Settings page, in the Columns section, your new column will be listed.
You can change the order of the column so it is closer to the First Name and Last Name
fields if you’d like (using the Column Ordering link below the list of columns); however,
because users will not be entering data in that field, it really only needs to be in the right
place in whatever views you create.
8. To see the new field in action, go back to the list’s content page (you’ll see a new column
for Full Name at the end of the list in the content area, just waiting for data), and click
Add New Item. Enter whatever data you’d like for the new contact item (see Figure 7.28