Crystal Reports provide a list of functions in the Function Tree of the Formula Workshop. Functions are used to manipulate data. There are different types of Crystal Reports functions that includes String, Math, Type Conversion, Date and Time. Let’s start with the Function Tree before we go into more details in this lesson.
The following screenshot shows the function tree in the Formula Workshop.

Formulas without control structures execute each expression in the formula exactly once when the formula is evaluated. The expressions are executed in a sequential fashion, from the first expression in the formula to the last.
Control structures enable you to allow some flexibility. Depending upon which control structure you choose, you can skip over some of the expressions or you can repeatedly evaluate some expressions depending on a condition.
Control structures are the primary means of expressing business logic. Typical report formulas make extensive use of them.

![A screenshot of a Crystal Reports Formula Editor shows a user creating a new formula—highlighted by yellow callouts and arrows—from the report fields pane and typing logic that maps Husband and Wife to Spouse (If {Employee.Emergency Contact Relationship} in [Husband,Wife] Then Spouse Else {Employee.Emergency Contact Relationship}) while sample data tables below demonstrate the effect by listing first and last names on the left and a resulting Emergency Contact column on the right with normalized and original relationship values such as Brother‑In‑Law, Spouse, Sister, Father, Son, and Cousin. A screenshot of a Crystal Reports Formula Editor shows a user creating a new formula—highlighted by yellow callouts and arrows—from the report fields pane and typing logic that maps Husband and Wife to Spouse (If {Employee.Emergency Contact Relationship} in [Husband,Wife] Then Spouse Else {Employee.Emergency Contact Relationship}) while sample data tables below demonstrate the effect by listing first and last names on the left and a resulting Emergency Contact column on the right with normalized and original relationship values such as Brother‑In‑Law, Spouse, Sister, Father, Son, and Cousin.](https://learning.sap.com/service/media/topic/db5f0d0a-975b-41c9-b5a2-11d8cc590734/BOC320_2025_en-US_media/BOC320_2025_en-US_images/Using If Then Else Formula.png)