Formula

Formula

A formula is an expression used to perform an operation by computing values between different fields in a table.The Formula Field in Zoho Tables allows you to compute the results of the formula entered and displays those results in that field.


It supports over 30 formulas now. Zoho Tables formulas are applied to the entire field of the table. This means that each record (cell) in the field gets updated when you use a formula. In a nutshell, formulas allow you to automate your workflow to speed up your process.


Note: The formula field's records are associated with the reference field's records (same row). You cannot associate Record 1 (in row 1) of the formula field to Record 2 (in row 2) of the reference field.


This section will walk you through the benefits of using Formula Field Type and how you can calculate just about anything.


  • Formula Editor
  • What are the formula field outcomes?
  • General Rules to follow for formulas
  • Formula Use case
  • Different types of formula



Formula Editor



The Formula Editor is the space in the Formula Field dialog box where you type in the formula and functions. Let us look into some of the functions and capabilities of the Formula Field Editor.


  • Colored Syntax Highlighter
  • Error Alerts


Colored Syntax Highlighter


As given in the above image,

    

Green indicates the functions

Black indicates fields

Grey denotes the reference field that has been deleted.

Red indicates an error message.


Error Alerts:

- The parenthesis are not balanced.

- The formula entered is incorrect (Unknown characters are present in the formula).

- Improper string termination. (The entered formula string is not terminated properly with " or ')

- There are insufficient parameters to perform the function.

- Too many parameters have been given to this function.

- The reference field is either incorrect or deleted from the table.

- The Field type is mismatched.

- The Formula entered includes a reference to itself.


What are the formula field outcomes?

The Formula field type dialog box changes according to the Field type you enter. There are three types of Formula Field outcomes —


  • Numerical Field outcome
  • Text Field Outcome
  • Date Field Outcome


Numerical Field outcome



  • Enter your formula: Enter the formula or function you want to compute.
  • Return Type: This will return the format type you want in the output. E.g., if you choose percent, then the output would be 75%.
  • Precision: Precision denotes the number of decimals displayed in the number field. E.g., For 345.0, if you select 1.000 then the output would be 345.000
  • Enable Thousand Separator: Enable a thousand separator to your numbers. E.g., 10000 will show as 10,000 where the comma is the thousand separator.


Text Field Outcome




  • Enter your formula: Enter the formula or function you want to compute.
  • Format: Choose the format you want your text to be in from the drop-down menu, which includes — None(whatever you typed will be displayed without applying any format), Capitalize Each Word, lowercase, UPPERCASE and Sentence case.


Date Field Outcome


  • Enter your Formula: Enter the formula or function you want to compute.
  • Date Format: Choose the format you want your date to be in from the drop-down menu, which includes — Month DD, YYYY, DD/MM/YYYY, MM/DD/YYYY, YYYY/MM/DD.
  • Time Format: Choose the format you want your time to be in from the 3 options, which include — None, 12hr, and 24hr.


There are different types of formulas in Zoho Tables. They are explained in detail in the sections below:

  1. Array Functions
  2. Text Operators and Functions
  3. Logical Operators & Functions
  4. Numeric Operators & Functions
  5. Date and Time Functions

ARRAY FUNCTIONS:

  1. ARRAY_JOIN([item1, item2, item3], separator)
  2. You can merge the array of items into one text with a separator between them.

Eg., ARRAYJOIN(Supplier Name,Supplier Surname, "; ")



  1. ARRAY_COUNT(field1, field2, field3, ...)
  2. This formula field allows you to count the number of chosen values in an array or a field with multiple values.
  3. For example: ARRAY_COUNT(Teacher Role, Previous Roles)
  4. This will return the total number of courses chosen for that record.


TEXT OPERATORS AND FUNCTIONS


  1. CONCATENATE(text1, text2,...)
  2. You can join two different texts together to make them into one text value.
  3.    E.g., CONCATENATE("Hi"," ", "there", "!")
  4. => Hi there!



  1. FIND(textToFind, whereToSearch,[startFromPosition])
  2. This formula finds an occurrence of text inside another text.
  3. textToFind: The text whose occurrence is to be found.
  4. whereToSearch: The text in which the search is performed.
  5. [startFromPosition]: (Optional) It starts searching from this position. Index starts from the position that you give. If not provided, it defaults to 1.


Eg., FIND("John", Supplier Name)



In the above use case, if John's name is found in the field, it gives you the position of the word.


Note: If the text occurrence is not found then the output will be 0.

  1. LEN(text)
  2. You can find the length of the text using this formula.


Eg., LEN(Supplier Name)




Note: If there is a space between the texts that will also be counted.


  1. LOWER(text)
  2. You can change the text to lowercase using this formula.


Eg., LOWER("Good morning!")



  1. UPPER(text)
  2. You can change the text to uppercase using this formula.


Eg., UPPER("What?")



  1. MID(text, whereToStart, count)
  2. You can take out a subtext within a text starting from whereToStart.

  3. text: The text will be cut.
  4. whereToStart: The starting position of the cut.
  5. count: Number of characters from starting position.


Eg., MID(Supplier Name, Where to Start, Count)



  1. SUBSTITUTE(whereToSearch, oldText, newText, [index])
  2. You can replace a text occurrence with a new text.

  3. whereToSearch: The text in which the search is performed.
  4. oldText: The text to be searched for.
  5. newText: The text to be replaced with.
  6. index(optional): If the same occurrenc (text) exists more than once, you can specify which occurrence to replace. If not specified, all occurrences will be replaced.


Eg..



LOGICAL OPERATORS AND FUNCTIONS

  1. AND(logical1, logical2,...)
  2. If all the fields have a value in them, the formula will return a 1 since all the arguments are true; otherwise a 0. Empty field values and 0's are treated as 0(False).

  3. Eg.,
  4. AND("a", "b")
  5. => 1 (True, only if both field values are true)

  6. AND("a", "")
  7. => 0 (False, when one or both field values aren't true)


In the below table, the Error Check field uses the AND formula to check if there are any empty records in the selected fields. The Error Check field returns 0 if any one of the records is empty.



  1. NOT(boolean)
  2. Using this function, an argument's logical meaning can be reversed.
  3.     E.g., Generally, 300 > 277 would be true, but if you wrote

  4. NOT("300 > 277")
  5. => 0 (False)



In the above table, we use the NOT formula to find clothes that are not yellow in color.

i.e., NOT(Color="Yellow") => O when the cloth color is yellow

NOT(Color="Yellow") => 1 when the cloth color is not yellow


This helps to count the number of clothes that are not yellow in color.


  1. OR(logical1, logical2,...)
  2. OR() returns 1(True) if one or all field values/arguments are true. If all the values/arguments are false, it returns 0 (False).


Eg., OR(Warehouse 1,Warehouse 2)



In the above table, we use the OR formula to check if the stock is available in Warehouse 1 or Warehouse 2. If it's available even in one Warehouse, it will show the output as 1 since the stock is available.


  1. XOR(logical1, logical2,...)
  2. Using this function, your output returns 1 (True) if an odd number of arguments are true.


For example,

  • If you are a Student, who has cleared both Unit Test 1 and Unit Test 2, then you're exempted from writing Unit Test 3.
  • If you have cleared only one unit test, then you have to give Unit Test 3.
  • If you have not cleared both Unit Test 1 and Unit Test 2, then you are not allowed to give Unit Test 3.



Now, in the above use case, you can use the XOR function for the Unit Test 3 field :

where the output would show as 1(True) if one (Odd number) field value is missing or 0(False) if both (Even number) field values are missing or available. i.e., XOR(Unit Test 1, Unit Test 2)


  1. IF(condition, value_if_true, value_if_false)
  2. This function checks a condition. If the condition is true, it returns one value; if false, it returns another.
  3. For example: IF(Total Marks > 250, "Pass", "Fail")
  4. This returns "Pass" if the student has scored above 250. Otherwise, it returns "Fail".


  1. IF_ERROR(expression, fallback_value)
  2. This function returns the result of the expression unless there's an error, in which case it returns a fallback value you define.
  3. For example: IF_ERROR(Total Marks / Total Courses, "No Course Chosen")
  4. If "Total Courses" is zero or empty, the result will be "No Course Chosen" instead of showing an error.



NUMERIC OPERATORS AND FUNCTIONS

  1. ABS()
  2. You get the absolute value (non-negative value without regard to its sign) as the output.


Eg., ABS(Profit)



  1. AVERAGE(number1, number2,...)
  2. You can find the average of the total numbers given, which is calculated by,
  3. sum of the values/total number of values.


Eg., AVERAGE(Stock, Leftover Stock)



  1. MAX()
  2. You can find the largest number among the given numbers.


Eg., MAX({Field1}, {Field2})

MAX(24, 56)

=> 56




  1. MIN(number1, number2)
  2. You can find the smallest number among the given numbers.


Eg., MIN(24, 56)

=> 24




  1. MOD(dividend,divisor)
  2. After dividing the first input by the second, you can find the remainder as the output


Eg., MOD(Stock, Leftover Stock)




  1. POWER(base, power)
  2. You can find the base value for the specified power.


Eg., POWER(BASE, Power of)




  1. ROUND(value,precision)
  2. You can find the round-off value to the specified decimal places.


Eg., ROUND(Numbers, Precision)



  1. SUM(number1, number2,...)
  2. You can find the sum of the given numbers as output.


Eg., SUM(Stocks Warehouse 1, Stock Warehouse 2)





DATE AND TIME FUNCTIONS

  1. DATE_ADD(date, number, 'units')
  2. You can add the date units to return another date in specified units.

  3. date: The date to which the value is added.
  4. number: The number which is added.
  5. units: The unit to which the number is scaled. It should be one of ["YEAR", "MONTH", "DAY", "HOUR", "MINUTE", "SECOND"].


Eg., DATE_ADD(Stock Expiry, "6", "day")




  1. DATETIME_DIFF(date1, date2, 'units')
  2. You can find the difference between two dates in the units that you specify.

  3. date1: First date.
  4. date2: Second date.
  5. units: The unit in which the difference is returned. It should be one of ["YEAR", "MONTH", "DAY", "HOUR", "MINUTE", "SECOND"].



Eg., DATETIME_DIFF(Date of stock purchase, Stock Expiry, "day")


  1. YEAR(date field)
  2. You can determine a date's 4-digit year using this formula.


Eg., YEAR(Stock Expiry)



  1. MONTH(date field)
  2. Your output will be displayed between 1 and 12 representing only the month from the date field.


Eg., MONTH("14/09/2016 9:45")
=> 9



  1. DAY(date field)
  2. In this case, the output will display only the day between 1- 31 from the date field.


Eg., DAY(Stock Expiry)



  1. HOUR(date time field)
  2. The output will range from 0 (12:00 am) to 23 (11:00 pm), representing the time in hours.


Eg., HOUR(Field 14)



  1. MINUTE()
  2. The output will be between 0 to 59, representing only the minute of the time.


Eg., MINUTE(Field 14)



  1. SECOND()
  2. The output will be between 0 to 59, representing only the seconds of the time.


Eg., SECOND(Field 14)


  1. EOMONTH(start_date, months)
  2. With this formula, you can find the last day of a month or a certain number of months before or after a specific date.
  3. Here, "start_date" is the reference date and "months" refers to how many months to move forward (positive number) or backward (negative number).
  4. For example: EOMONTH(Puchase Date, 1)
  5. This returns the last date of the next month from the purchase date.

  1. NOW()
  2. This formula gives you the current date and time at the moment the formula runs. This is useful for real-time tracking.
  3. For example: NOW()


      Create. Review. Publish.

      Write, edit, collaborate on, and publish documents to different content management platforms.

      Get Started Now


        Access your files securely 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 CRM Training
            Redefine the way you work
            with Zoho Workplace

              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.

              Zoho CRM Training

                Create, share, and deliver

                beautiful slides from anywhere.

                Get Started Now


                  Zoho Sign now offers specialized one-on-one training for both administrators and developers.

                  BOOK A SESSION







                              Quick LinksWorkflow AutomationData Collection
                              Web FormsEnterpriseOnline Data Collection Tool
                              Embeddable FormsBankingBegin Data Collection
                              Interactive FormsWorkplaceData Collection App
                              CRM FormsCustomer ServiceAccessible Forms
                              Digital FormsMarketingForms for Small Business
                              HTML FormsEducationForms for Enterprise
                              Contact FormsE-commerceForms for any business
                              Lead Generation FormsHealthcareForms for Startups
                              Wordpress FormsCustomer onboardingForms for Small Business
                              No Code FormsConstructionRSVP tool for holidays
                              Free FormsTravelFeatures for Order Forms
                              Prefill FormsNon-Profit

                              Intake FormsLegal
                              Mobile App
                              Form DesignerHR
                              Mobile Forms
                              Card FormsFoodOffline Forms
                              Assign FormsPhotographyMobile Forms Features
                              Translate FormsReal EstateKiosk in Mobile Forms
                              Electronic Forms
                              Drag & drop form builder

                              Notification Emails for FormsAlternativesSecurity & Compliance
                              Holiday FormsGoogle Forms alternative GDPR
                              Form to PDFJotform alternativeHIPAA Forms
                              Email FormsFormstack alternativeEncrypted Forms

                              Wufoo alternativeSecure Forms

                              TypeformWCAG


                                          Create. Review. Publish.

                                          Write, edit, collaborate on, and publish documents to different content management platforms.

                                          Get Started Now




                                                            You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                                Manage your brands on social media


                                                                  • Desk Community Learning Series


                                                                  • Digest


                                                                  • Functions


                                                                  • Meetups


                                                                  • Kbase


                                                                  • Resources


                                                                  • Glossary


                                                                  • Desk Marketplace


                                                                  • MVP Corner


                                                                  • Word of the Day


                                                                  • Ask the Experts


                                                                    Zoho Sheet Resources

                                                                     

                                                                        Zoho Forms Resources


                                                                          Secure your business
                                                                          communication with Zoho Mail


                                                                          Mail on the move with
                                                                          Zoho Mail mobile application

                                                                            Stay on top of your schedule
                                                                            at all times


                                                                            Carry your calendar with you
                                                                            Anytime, anywhere




                                                                                  Zoho Sign Resources

                                                                                    Sign, Paperless!

                                                                                    Sign and send business documents on the go!

                                                                                    Get Started Now




                                                                                            Zoho TeamInbox Resources





                                                                                                      Zoho DataPrep Demo

                                                                                                      Get a personalized demo or POC

                                                                                                      REGISTER NOW


                                                                                                        Design. Discuss. Deliver.

                                                                                                        Create visually engaging stories with Zoho Show.

                                                                                                        Get Started Now








                                                                                                                            • Related Articles

                                                                                                                            • Creating a base using AI

                                                                                                                              Plan Free & Professional User Permissions Owner, Portal Manager, Workspace Manager Platform Web, iOS, and Android You can create customized bases that suit your workflow with just a simple prompt using Zoho's AI-powered assistant, Zia. How to create ...
                                                                                                                            • Creating a base using AI

                                                                                                                              You can create customized bases that suit your workflow with just a simple prompt using Zoho's AI-powered assistant, Zia. How to create a base using AI Navigate to the workspace where you want to create a base and click the + button to create a new ...
                                                                                                                            • Creating a base using AI

                                                                                                                              You can create customized bases that suit your workflow with just a simple prompt using Zoho's AI-powered assistant, Zia. How to create a base using AI Navigate to the workspace where you want to create a base and click the + button. You'll see the ...
                                                                                                                            • Include a field summary in an email or Zoho Cliq message

                                                                                                                              The 'Add Field Summary' feature allows you to dynamically insert aggregated data from your table into email or message content. If you're a sales manager aiming to report the total revenue from successful deliveries each month, you can automate this ...
                                                                                                                            • Creating smart relationships

                                                                                                                              Plan Free & Professional User Permissions Manager, and Editor Platform Web, Android & iOS Smart relationships allow you to link different tables within a base and thereby, allows for easy data updates across tables and data retrieval. Create a link ...
                                                                                                                              Wherever you are is as good as
                                                                                                                              your workplace

                                                                                                                                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.



                                                                                                                                  Zoho Show Resources