Join us in the Zoho Extensions Development Bootcamp scheduled across cities in India Register Now

Skip to product menu
close
  • Recent Launches
    Press Space or Enter to display list of options
EXPLORE ALL PRODUCTS

Recent Launches

New

Easy domain registration, transfer, and secured DNS management.

Try now
New

Payroll software with automated tax payments and filing.

Try now
New

Low-code IoT platform and solutions for connected businesses.

Try now
New

Business formation service to launch and grow your businesses.

Try now
New

Unified payment solution built for all businesses.

Try now
New

Comprehensive email security and archiving for every business.

Try now
Suites

Cloud-based qualitative data analysis tool.

Try now
New

Online community platform for individuals and businesses to grow their network and brand.

Try now
New

Modern retail POS to sell better, manage your entire business, and join the digital revolution.

Try now
SuitesNew

Unified project management platform for intelligent, data-driven work.

Try now
Suites

Unified platform for customer service and support teams.

Try now

Sales

CRM

Comprehensive CRM platform for customer-facing teams.

CRM
Voice

Cloud Contact Center Software for businesses.

Voice
Sign

Digital signature app for businesses.

Sign
Forms

Build online forms for every business need.

Forms
Bigin

Simple CRM for small businesses moving from spreadsheets.

Bigin
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
Bookings

Appointment scheduling app for consultations with customers.

Bookings
RouteIQ

Comprehensive sales map visualization and optimal route planning solution.

RouteIQ
Thrive

Complete loyalty and affiliate management platform.

Thrive
Suites
CRM Plus

Unified platform to deliver top-notch customer experience.

CRM Plus

Marketing

Campaigns

Create, send, and track targeted email campaigns that drive sales.

Campaigns
Voice

Cloud Contact Center Software for businesses.

Voice
Sign

Digital signature app for businesses.

Sign
Forms

Build online forms for every business need.

Forms
Social

All-in-one social media management software.

Social
Survey

Design surveys to reach and interact with your audience.

Survey
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
Sites

Online website builder with extensive customisation options.

Sites
Backstage

End-to-end event management software.

Backstage
PageSense

Website conversion optimization and personalisation platform.

PageSense
Marketing Automation

All-in-one marketing automation software.

Marketing Automation
LandingPage

Smart landing page builder to increase conversion rates

LandingPage
Webinar

Webinar platform for webcasting online webinars.

Webinar
NEW
LeadChain

Sync, manage, and convert leads across channels seamlessly.

LeadChain
NEW
Domains

Easy domain registration, transfer, and secured DNS management.

Domains
NEW
CommunitySpaces

Online community platform for individuals and businesses to grow their network and brand.

CommunitySpaces
Thrive

Complete loyalty and affiliate management platform.

Thrive
Publish

Manage all your local business listings on a single platform.

Publish
Suites
Marketing Plus

Unified marketing platform for marketing teams.

Marketing Plus

Commerce and POS

Commerce

eCommerce platform to manage and market your online store.

Commerce

Service

Desk

Helpdesk software to deliver great customer support.

Desk
Assist

Remote support and unattended remote access software.

Assist
Voice

Cloud Contact Center Software for businesses.

Voice
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
Bookings

Appointment scheduling app for consultations with customers.

Bookings
FSM

End-to-end field service management platform for service businesses.

FSM
Lens

Interactive remote assistance software with augmented reality.

Lens
Solo

The all-in-one toolkit for solopreneurs.

Solo
Suites
Service Plus

Unified platform for customer service and support teams.

Service Plus

Finance

Books

Powerful accounting platform for growing businesses.

Books
Expense

Effortless expense reporting platform.

Expense
Sign

Digital signature app for businesses.

Sign
Inventory

Powerful stock management and inventory control software.

Inventory
FREE
Invoice

100% Free invoicing solution.

Invoice
Billing

End-to-end billing solution for your business.

Billing
NEW
Payroll

Payroll software with automated tax payments and filing.

Payroll
Commerce

eCommerce platform to manage and market your online store.

Commerce
Checkout

Collect payments online with custom branded pages.

Checkout
Practice

Practice management software for accounting firms.

Practice
Solo

The all-in-one toolkit for solopreneurs.

Solo
NEW
Payments

Unified payment solution built for all businesses.

Payments
Suites
Finance Plus

All-in-one suite to manage your operations and finances.

Finance Plus

Email, Storage, and Collaboration

Mail

Secure email service for teams of all sizes.

Mail
Voice

Cloud Contact Center Software for businesses.

Voice
Sign

Digital signature app for businesses.

Sign
WorkDrive

Online file management for teams.

WorkDrive
Bookings

Appointment scheduling app for consultations with customers.

Bookings
Cliq

Stay in touch with teams no matter where you are.

Cliq
Notebook

Beautiful home for all your notes.

Notebook
Meeting

Online meeting software for all your video conferencing & webinar needs.

Meeting
Connect

Employee experience platform to communicate, engage, and build positive employee relations.

Connect
Learn

Knowledge and learning management platform.

Learn
Office Integrator

Built in document editors for web apps.

Office Integrator
Writer

Word processor for focused writing and discussions.

Writer
TeamInbox

Shared inboxes for teams.

TeamInbox
ZeptoMail

Secure and reliable transactional email sending service.

ZeptoMail
Show

Create, edit, and share slides with a sleek presentation app.

Show
Tables

Work management tool to connect people, processes, and information.

Tables
Sheet

Spreadsheet software for collaborative teams.

Sheet
Office Suite

Powerful collaborative work platform for teams.

Office Suite
Calendar

Online business calendar to manage events and schedule appointments.

Calendar
ToDo

Collaborative task management for individuals and teams.

ToDo
FREE
PDF Editor

Collaborative online PDF editing tool.

PDF Editor
Suites
Workplace

Application suite built to improve team productivity and collaboration.

Workplace

Human Resources

Expense

Effortless expense reporting platform.

Expense
Recruit

Intuitive recruiting platform built to provide hiring solutions.

Recruit
People

Organize, automate, and simplify your HR processes.

People
Sign

Digital signature app for businesses.

Sign
NEW
Payroll

Payroll software with automated tax payments and filing.

Payroll
Shifts

Employee scheduling and time tracking app.

Shifts
Workerly

Manage temporary staffing with an employee scheduling solution.

Workerly
Suites
People Plus

Comprehensive HR platform for seamless employee experiences.

People Plus

Security and IT Management

Creator

Build custom apps to simplify business processes.

Creator
Assist

Remote support and unattended remote access software.

Assist
Vault

Online password manager for teams.

Vault
Directory

Workforce identity and access management solution for cloud businesses.

Directory
Lens

Interactive remote assistance software with augmented reality.

Lens
QEngine

Test automation software to build, manage, execute, and report testcases.

QEngine
Catalyst

Pro-code platform to build and deploy your apps.

Catalyst
RPA

Automate manual, tedious, and repetitive tasks easily.

RPA
NEW
eProtect

Comprehensive email security and archiving for every business.

eProtect
FREE
OneAuth

Secure multi-factor authenticator (MFA) for all your online accounts.

OneAuth
Toolkit

Complete resource for any admin-related lookup queries.

Toolkit

BI and Analytics

Analytics

Modern self-service BI and analytics platform.

Analytics
DataPrep

AI-powered data preparation service for your data-driven organization.

DataPrep
NEW
IoT

Harnessing IoT analytics for real-time operational intelligence.

IoT
Embedded BI

Embedded analytics and white label BI solutions, tailored for your needs.

Embedded BI

Project Management

Projects

Manage, track, and collaborate on projects with teams.

Projects
Sprints

Planning and tracking tool for scrum teams.

Sprints
BugTracker

Automatic bug tracking software for managing bugs.

BugTracker
Solo

The all-in-one toolkit for solopreneurs.

Solo
Suites
Projects Plus

Unified project management platform for intelligent, data-driven work.

Projects Plus

Developer Platforms

Creator

Build custom apps to simplify business processes.

Creator
Flow

Automate business workflows by creating smart integrations.

Flow
Office Integrator

Built in document editors for web apps.

Office Integrator
DataPrep

AI-powered data preparation service for your data-driven organization.

DataPrep
ZeptoMail

Secure and reliable transactional email sending service.

ZeptoMail
Tables

Work management tool to connect people, processes, and information.

Tables
QEngine

Test automation software to build, manage, execute, and report testcases.

QEngine
Catalyst

Pro-code platform to build and deploy your apps.

Catalyst
RPA

Automate manual, tedious, and repetitive tasks easily.

RPA
NEW
IoT

Build, deploy, and scale IoT solutions for connected businesses.

IoT
Apptics

Application analytics for all apps.

Apptics
Embedded BI

Embedded analytics and white label BI solutions, tailored for your needs.

Embedded BI

IoT

NEW
IoT

Low-code IoT platform and solutions for connected businesses.

IoT

Search Result

CRM Plus

Unified platform to deliver top-notch customer experience.

Try now
CRM Plus
Service Plus

Unified platform for customer service and support teams.

Try now
Service Plus
Finance Plus

All-in-one suite to manage your operations and finances.

Try now
Finance Plus
People Plus

Comprehensive HR platform for seamless employee experiences.

Try now
People Plus
Workplace

Application suite built to improve team productivity and collaboration.

Try now
Workplace
Marketing Plus

Unified marketing platform for marketing teams.

Try now
Marketing Plus
Projects Plus

Unified project management platform for intelligent, data-driven work.

Try now
Projects Plus
All-in-one suite

Zoho One

The Operating System for Business

Run your entire business on Zoho with our unified cloud software, designed to help you break down silos between departments and increase organizational efficiency.

TRY ZOHO ONE
Zoho Marketplace

With over 2000 ready-to-use extensions across 40+ categories, connect your favorite business tools with the Zoho products you already use.

EXPLORE MARKETPLACE
Skip to main content

Creating Formula Fields

Formula fields are used to calculate different types of values, including numeric values, text values, date values, etc. Formula fields and their resulting return value have certain data types associated with them and there are specific operators that can be used for each data type. It is necessary to understand the type of fields required for creating formula fields and the compatibility between the data types and the operators. For instance, the operator " * " (for multiplication) is used on numeric values and not on text values.

  • You cannot modify the Return type for the formula fields.
  • Maximum 1000 characters can be used in the formula expression.

 Create Numeric Formula Field

The following table helps you to understand the type of arguments required for numeric functions along with the type of syntax that needs to be formed.

Function

Description

Usage

Examples

Abs

Returns the absolute value of the Number.

Abs(number)

Abs(-42) returns 42; Abs(+33) returns 33

Ceil

Returns the smallest digit greater than or equal to the input number.

Ceil(number)

Ceil(3.4) returns 4; Ceil(-3.4) returns -3

Floor

Returns the largest digit less than or equal to the input number.

Floor(number)

Floor(3.8) returns 3; Floor(-3.4) returns -4

Naturallog

Returns the natural logarithm of a number

Naturallog(number)

Naturallog(1) returns 0.69

Base10log

Returns the base 10 logarithm of the input number

Base10log(number)

Base10log(10) returns 1.0

Max

Returns the maximum value from the specified list of compatible data types.

Max(value1, value2,...)

Max(3,1,5,2) returns 5; Max(0,-4,-3,2) returns 2

Min

Returns the minimum value from the specified list of compatible data types.

Min(value1, value2,...)

Min(5,-3,0,1) returns -3; Min(5,0,.01,0.5) returns 0.0

Sqrt

Returns the square root of the input number.

Sqrt(number)

Sqrt(4) returns 2; Sqrt(9) returns 3

To create numeric type formula fields

  1. Log in to Zoho Platform and select the application in which the field has to be added.
  2. Click Customize > Fields.
  3. Click the required module in which the field has to be added from the Module List drop-down list box and click New Custom Field.
    Module refers to the Leads, Accounts, Contacts, etc. tabs.
  4. In the Create Custom Field page, select the field type as Formula.
  5. In the Provide Field Details window, do the following:
    • Enter a name in the Field Label field..
    • Select Number/Currency as the Formula Return Type from the drop-down list.
    • In the case of Number and Currency Return Type fields, enter a value for Decimal places.

    Constructing Formulas
  6. Under Select Functions, select Numeric Functions from the drop-down list.
  7. From the list of Numeric Functions, choose a function and click Insert.
    (Alternatively, you can double-click on a function to insert)
  8. In the Formula expression, click between the parenthesis to insert an argument.
  9. Under Select Field column, choose a field and click Insert.
    (Alternatively, you can double-click on a field to insert)
  10. Under Select Operator column, choose an operator and click Insert.
  11. Click Check Syntax to check the construction of the formula.
  12. Click Save.

 Create String Formula Field

The following table helps you to understand the type of arguments required for formula functions along with the type of syntax that needs to be formed.

FunctionDescriptionUsageExamples
LenReturns the number of characters in a specified text string.Len(string)Len('abc') returns 3; Len(' abc ') returns 5
FindReturns the nth occurrence of the text string.Find('string','search string',number)Find('greenery','n',1) returns 5
ConcatReturns the concatenation of all the strings.Concat('string','string',...)Concat('FirstName',' ','LastName') returns FirstName LastName
ContainsReturns true if search string is found in the other string, otherwise returns false.Contains('string','search string')Contains('abcdef','cd') returns true
StartswithReturns true if the string begins with the search string, otherwise returns false.Startswith('string','search string')Startswith('abcdef','cd') returns false
Startswith('abcdef','abc') returns true
EndswithReturns true if the string ends with the search string, otherwise returns false.Endswith('string','search string')Endswith('abcdef','ab') returns false
Endswith('abcdef','ef') returns true
LowerConverts all characters in a string to lower case.Lower('string')Lower('APPLES') returns "apples"
Lower('Apples') returns "apples"
UpperConverts all characters in a string to upper case.Upper('string')Upper('apples') returns "APPLES"
Upper('APPles') returns "APPLES"
TrimReturns string with the leading and trailing white space characters removed.Trim('string')Trim(' abcd ') returns "abcd"
SubstringReturns a portion of an input string, from a start position in the string to the specified length.Substring('string',n1,n2)Substring('abcdefg',4,7) returns "defg"
ReplaceReplaces each occurrence of the search string in the input string with the corresponding replace string.Replace('string','search string','replace string')Replace('abcdefg','abc','xyz') returns "xyzdefg"
TostringConverts any argument to a string data type.Tostring(generic argument)Tostring(3.4) returns "3.4"
Tostring('') returns <empty>

Note

  • The string constants should always be enclosed in single quotes(')
  • Field labels do not need to be enclosed in single quotes (').

To create String type formula fields

  1. Log in to Zoho Platform and select the application in which the field has to be added.
  2. Click Customize > Fields.
  3. Click the required module in which the field has to be added from the Module List drop-down list box and click New Custom Field.
    Module refers to the Leads, Accounts, Contacts, etc. tabs.
  4. In the Create Custom Field page, select the field type as Formula.
     
  5. In the Provide Field Details window, do the following:
    • Enter a name in the Label field.
    • Select String as the Formula Return Type from the drop-down list.

    Constructing Formulas
  6. Under Select Functions, select String Functions from the drop-down list.
  7. From the list of String Functions, choose a function and click Insert.
    (Alternatively, you can double-click on a function to insert)
  8. In the Formula expression, click between the parenthesis to insert an argument.
  9. Under Select Field column, choose a field and click Insert.
    (Alternatively, you can double-click on a field to insert)
  10. Under Select Operator column, choose an operator and click Insert.
  11. Click Check Syntax to check the construction of the formula.
  12. Click Save.

 Create DateTime Formula Field

The following table helps you to understand the type of arguments required for DateTime functions along with the type of syntax that needs to be formed.

FunctionDescriptionUsageExamples
NewdateCreates a date from the year, month, day and time.Newdate(year,month,day, hour,minute,'string')Newdate(2007,12,21,06,30,'AM') returns quot;21/12/2007 06:30 AM"1
DatepartReturns the date value for the date time expression.Datepart(datetime argument)Datepart(Newdate(2007,12,21,06,30,'AM')) returns "21/12/2007"1
TimepartReturns the time value for the date time expression.Timepart(datetime argument)Timepart(Newdate(2007,12,21,06,30,'AM')) returns "06.30 AM"
AdddateReturns the date obtained by adding n (year/day/month/hour/min) to the given date.Adddate(datetime,number, 'string')Adddate(Newdate(2007,12,21,06,30,'AM'),2,'YEAR' returns "21/12/2009 06:30 AM"2
SubdateReturns the date obtained by subtracting n (year/day/month/hour/min) to the given date.Subdate(datetime,number, 'string')Subdate (Newdate(2007,12,21,06,30,'AM'),2,'YEAR' returns "21/12/2005 06:30 AM"2
NowReturns a date/time representing the current moment.Now()Now() returns "19/05/2009 10:52 AM"
DatecompCompares two dates and returns the difference of days in minutes.Datecomp(Datetime, Datetime)Datecomp(Newdate(2009,05,19,11,30,'AM'), Newdate(2009,05,19,12,30,'AM')) returns 660.0 3
DayofmonthReturns the day of the month for the given date.Dayofmonth(Datetime)Dayofmonth(Newdate(2009,05,19,11,30,'AM')) returns "19.0"
HourReturns the hour corresponding to the given date.Hour(Datetime)Hour(Newdate(2009,05,19,11,30,'AM')) returns "11.0"
MinuteReturns the minute corresponding to the given date.Minute(Datetime)Minute(Newdate(2009,05,19,11,30,'AM')) returns "30.0"
MonthReturns the month corresponding to the given date.Month(Datetime)Month(Newdate(2009,05,19,11,30,'AM')) returns "5.0"
YearReturns the year corresponding to the given dateYear(Datetime)Year(Newdate(2009,05,19,11,30,'AM')) returns "2009.0"
WeekdayReturns the day of the week (1-7) corresponding to the input date, where 1 is Sunday, 2 is Monday and so on.Weekday(Datetime)Weekday(Newdate(2009,05,19,11,30,'AM')) returns "3.0". (This is because 19th May is Tuesday)4
  1. The input DateTime argument format should always be YYYY,MM,DD,HH,MM,AM/PM but the output will be displayed as per the selected Country Locale.
  2. The string data type (YEAR/DAY/MONTH/HOUR/MINUTE) should be in UPPERCASE.
  3. The resulting return value for the Datecomp function is always displayed in minutes.
  4. If the date value is "0" the function returns null.

To create date time type formula fields

  1. Log in to Zoho Platform and select the application in which the field has to be added.
  2. Click Customize > Fields.
  3. Click the required module in which the field has to be added from the Module List drop-down list box and click New Custom Field.
    Module refers to the Leads, Accounts, Contacts, etc. tabs.
  4. In the Create Custom Field page, select the field type as Formula.
     
  5. In the Provide Field Details window, do the following:
    • Enter a name in the Label field.
    • Select DateTime as the Formula Return Type from the drop-down list.

    Constructing Formulas
  6. Under Select Functions, select DateTime Functions from the drop-down list.
  7. From the list of DateTime Functions, choose a function and click Insert.
    (Alternatively, you can double-click on a function to insert)
  8. In the Formula expression, click between the parenthesis to insert an argument.
  9. Under Select Field column, choose a field and click Insert.
    (Alternatively, you can double-click on a field to insert)
  10. Under Select Operator column, choose an operator and click Insert.
  11. Click Check Syntax to check the construction of the formula.
  12. Click Save.

 Create Boolean Formula Field

The following table helps you to understand the type of arguments required for boolean functions along with the type of syntax that needs to be formed.

FunctionDescriptionUsageExamples
IfReturns one of two values, depending on the value of a given logical condition. If the boolean test is true, If() returns the true value, otherwise returns the false value.If(Boolean,Generic, Generic)*If(8>7,1,0) returns "1.0"
If(8>7,'True','False') returns "True"
AndReturns a true response if all expressions are true; returns a false value even if one of the expressions is false.And(boolean,boolean ...)And(2>1,5>3,7<8) returns "true"
And(2>1,5>3,7>8) returns "false"
OrReturns true if any one expression is true. Returns false if all expressions are false.Or(boolean,...)Or(2>1,3>5,7>8) returns "true"
Or(1>2,3>5,7>8) returns "false"
NotReturns the logical negation of the given expression(If the expression is true, returns false).Not(boolean)Not(false) returns "true"
Not(true) returns "false"

* Generic implies any data type - Number, String, Datetime (including normal date) or Boolean. The return type depends on the selected data type. For instance, if the generic data type is a number, the return type should be Numeric and not string or boolean.

To create boolean type formula fields

  1. Log in to Zoho Platform and select the application in which the field has to be added.
  2. Click Customize > Fields.
  3. Click the required module in which the field has to be added from the Module List drop-down list box and click New Custom Field.
    Module refers to the Leads, Accounts, Contacts, etc. tabs.
  4. In the Create Custom Field page, select the field type as Formula.
     
  5. In the Provide Field Details window, do the following:
    • Enter a name in the Label field.
    • Select Boolean Functions as the Formula Return Type from the drop-down list.

    Constructing Formula
  6. Under Select Functions, select Boolean Functions from the drop-down list.
  7. From the list of Boolean Functions, choose a function and click Insert.
    (Alternatively, you can double-click on a function to insert)
  8. In the Formula expression, click between the parenthesis to insert an argument.
  9. Under Select Field column, choose a field and click Insert.
    (Alternatively, you can double-click on a field to insert)
  10. Under Select Operator column, choose an operator and click Insert.
  11. Click Check Syntax to check the construction of the formula.
  12. Click Save.

 Formula Syntax Reference

The following table displays the functional reference for creating formulae along with their available arguments.

 Numeric Functions

Function Name No. of Required Arguments Argument Data Type Return Type
Abs1NumberNumber
Ceil1Numbernumber
Floor1NumberNumber
Naturallog1NumberNumber
Base10log1NumberNumber
MaxMultipleAll NumberNumber
MinMultipleAll NumberNumber
Sqrt1NumberNumber

 String Functions

Function NameNo. of Required ArgumentsArgument Data Type>Return Type
Len1StringNumber
Find3String: String: NumberNumber
ConcatMultipleAll StringString
Contains2String: StringBoolean
Startswith2String: StringBoolean
Endswith2String: StringBoolean
Lower1StringString
Upper1StringString
Trim1StringString
Substring3String: Number: NumberString
Replace3String: String: StringString
Tostring1Any data typeString

 DateTime Functions

Function NameNo. of Required ArgumentsArgument Data TypeReturn Type
Newdate6Number:Number:Number:Number:Number:StringDatetime
Datepart1DatetimeString
Timepart1DatetimeString
Adddate3Datetime: Number: StringDatetime
Subdate3Datetime: Number: StringDatetime
Now0-Datetime
Datecomp2Datetime: DatetimeNumber
Dayofmonth1DatetimeNumber
Hour1DatetimeNumber
Minute1DatetimeNumber
Month1DatetimeNumber
Year1DatetimeNumber
Weekday1DatetimeNumber

 Boolean Functions

Function NameNo. of Required ArgumentsArgument Data TypeReturn Type
If3Boolean: Generic: GenericGeneric
AndMultipleAll BooleanBoolean
OrMultipleAll BooleanBoolean
Not1BooleanBoolean

Note

  • String constants should be enclosed within single quotes.
  • Generic implies any data type - Number, String, Datetime (including normal date) or Boolean.

 Related Topics

Standard Fields  | Custom Fields  | Formula Field Data types  | Formula Functions