# Examples of Formula Field

Formula Fields can be complicated sometimes. So, here are examples that will help you understand the usage of these types of fields in Zoho CRM.

1. IF ELSE Statement Example: If field name contains 'Golf Only 1 Meal', then return 265 ; Else if field name .contains 'Golf Only 2 Meals' return 295 else if field name contains 'Single Occ' return 665 or return 0
Formula: If(Contains(\${Contacts.fieldname}, 'Golf Only 1 Meal'),265,If(Contains(\${Contacts.fieldname},'Golf Only 2 Meals'),295,If(Contains(\${Contacts.fieldname},'Single Occ'),665,0 ) ) )
2. Example:
A manually entered Level; say A,B,C
A manually entered File Received Date (Start Date)
A formula field, that calculates a deadline date, based on the level and the File Received Date fields. This is called ''due date''.
The calculation for Due Date -
• If ''Level'' = A then the ''Due Date'' = ''File Received Date'' + 14 days
• If ''Level'' = B then the ''Due Date'' = ''File Received Date'' + 10 days
• If ''Level'' = C then the ''Due Date'' = ''File Received Date'' + 5 days
3. Example: To calculate the age based on the Date of Birth details.

Formula:
• Age in Years =
• Age in Months = (Datecomp(Now(),\${Leads.DOB}))/(60*24*30)
4. Create a matrix or a combination of two or three fields.
Example:
A Product has number fields namely StyleColor and Size.
Another field Product Matrix, should give the output as a combination of Style, Color and Size values.

Formula:
Concat(Tostring(\${Products.Style}),Tostring(\${Products.Colour}),Tostring(\${Products.Size}))
Return Type: String
5. Change the return type of the drop-down value as a number and calculate the values of two or more drop-down fields.
Note that the drop-down values are considered as string values, and not number values.

Example:
Drop-down 1 Values - 10, 20, 30
Drop-down 2 Values - 5, 10, 15
Formula (number) fieldÃ‚ needs to calculate - (Drop-down 1*Drop-down 2)+Drop-down 2

Formula:
(Tonumber(Drop-down 1)*Tonumber(Drop-down 2))+Tonumber(Drop-down 2)
Return Type: Number

### Zoho DataPrep Personalized Demo

If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

Create, share, and deliver

beautiful slides from anywhere.

### Zoho CRM Training Programs

Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

# Zoho DataPrep Resources

Zoho DataPrep Demo

Get a personalized demo or POC

Design. Discuss. Deliver.

Create visually engaging stories with Zoho Show.

• # Related Articles

• ## Data types in Formula Fields

Data type is the kind of data that can be held and stored while evaluating an expression. Data types are the defined set of values and the allowable operations on those values. They represent either the function, argument, return value or the ...
• ## Building Formula Fields

The Zoho CRM formula fields enable you to define fields that can populate dynamically calculated data based on the values returned from other standard or custom fields. For instance, an insurance company may need to determine, if the provided date of ...
• ## Types of Custom Fields

In Zoho CRM, you can add different types of custom fields as per your requirements. These fields will be available to all the users added to your organization's CRM account. Customize Zoho Defined Fields: You can edit, delete and hide some of Zoho ...
• ## Functions in Formula Fields

Function performs a specific operation on values that you specify and generates a new value. To compose a function, you need to type the function name, followed by a set of parentheses(). The Zoho CRM formula type custom field supports four different ...
• ## Working with Custom Fields

In Zoho CRM, you can add new fields as per your requirements. These fields will be available to all the users added to your organization's CRM account. Customize Zoho Defined Fields: You can edit, delete and hide some of Zoho defined fields, but note ...

# Resources

### Videos

Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.

### eBooks

Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.

### Webinars

Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.

### CRM Tips

Make the most of Zoho CRM with these useful tips.