Skip to main content

How to use the Formula field

Streamline daily processes and expand your possibilities with Formula field in NetHunt.

Here In NetHunt CRM, you may find a special formula-type field that helps us perform calculations between the required fields and get values when certain conditions are met. In this article, we will tell you how to free yourself from this routine and rely on pure automation🪄

What the formula field can do:

  1. Add or subtract, divide, and multiply fields among themselves.

  2. Commission calculation.

  3. Discount calculation.

  4. Calculation of the number of days, months, and years between dates.

  5. Text value generation.

  6. Generating a link URL.

  7. Conditional formatting of numbers.


In order for a formula-type field to perform some calculations, we first need to add several fields of number, percentage, or currency type. Go to Settings -> Folder and field management -> Choose a folder -> Fields:

⚠️ Formula-type fields require exact field names used for calculations. Otherwise, you will receive an error message

The formula field cooperates only with simple fields and cannot take the results of other formula fields into its calculations. That is, there is no possibility of subtracting the result of formula 1 from the result of formula 2. To do this, it is necessary to write the content of the entire formula 1 in your new formula and subtract the content of the entire formula 2 from it


Operations with sums, differences, division, and multiplication

First, let's sum the fields 'First payment' + 'Second payment' to get the total amount (you can add more than two number fields for these simple calculations). Type in the calculation that will be performed in the formula field. Here is an example of a needed formula:

= field("First payment") + field("Second payment")

Now the formula field will calculate the total amount we received from this company:

We can also calculate the Client's debt by creating another field 'Service cost' that will participate in the calculations. Example formula:

​= field("Service cost") - field("Total paid")

To multiply the fields together, use the sign *. For instance, let's calculate the cost of an annual subscription for specific services. To do this, we will create separate fields 'Monthly cost' and a formula 'Annual cost':

​= field("Monthly cost") * 12

To perform division operations, use the sign /. In this example, we will calculate the monthly payment from the total cost with the following formula:

​= field("Annual cost") / 12


Discount calculation

Imagine you need to calculate the cost of a service with a discount, and recently you have sent a promo that states everyone who orders 10 or more items of your product receives a 20% discount on a bill. The fields 'Quantity' and 'Cost per item' in numbers will give us the full cost calculation, and the formula field 'Total price (with 20% discount)' will show the discounted cost:

= field("Quantity") * field("Cost per item")

= (field("Quantity") * field("Cost per item")) * 0.8

Commission calculation

Imagine you are a real estate agent, and you have a deal and all the related information. When you fill out all the information you have in respective fields, the 'Commission $' field will automatically calculate your commission for a closed deal:

Add fields a currency field 'Total price' and 'Commission' in percents, later add a field 'Formula' with the following structure:

= field("Total price") * field("Commission")

Amount of time between two given dates

In addition to operations with numeric fields, the formula field can also subtract the date from the date to calculate the difference in days, months, and years (it might come in handy when you need to see how many days ago the last interaction with a record was, or how many days passed from its creation to its successful implementation):

=_time.days_between(field("Date of creation"), field("Date of implementation"))

​=_time.months_between(field("Date of creation"), field("Date of implementation"))


Generating a clickable URL

For URLs that are composed of the domain and the ID, you can create a clickable URL field in NetHunt. To do so, set up separate fields for the website and the ID and a text statistical field to combine the two:

When you put in the values for your two text fields (Amazon and Ricoh Imaging in our example) your formula = field("Web-site") .. "" .. field("ID") will generate a clickable URL:

You can click on it and open it in the new or current tab, and this feature can work for multiple websites and IDs:

Text value generation

A formula field can also add text values by checking the required fields: if a field is always equal to the specific value, then a formula will show the required result. In our case, the field with the name of the city Rome is used and the formula is 'Region':

You can also make this formula more complex with If, Or, Then, and Else helpers for several values to be equal to 'Europe' and others to a new parameter 'North America':

= if field("City") == "Rome" or field("City") == "Milan" or field("City") == "Palermo" then "Europe" else if field("City") == "Washington" then "North America" else""


Conditional formatting of numbers

Let's stick to the same conditionals If, Then, Or, and Else.

  • ​Example 1. If you need to calculate the percentage of a discount on the condition that more than 100 units are ordered:

= if field("Number of articles") > 100 then 0.1 else 0

⚠️The output format of a formula should be 'Percent'

Next, we can calculate the final cost based on the price and the discount:


= field("Price") - (field("Price")*field("Discount"))

  • Example 2. If you have a field that is responsible for currency type (e.g the US dollar (USD) as a drop-down menu with multiple presets) and you need to immediately convert the deal amount into Ukrainian hryvnia (UAH) at the exchange rate, we can use the following formula:

= if field("Currency") == "USD" then field("Deal amount") * field("Exchange rate") else field("Deal amount")

Surveys and Value Calculation

The Survey functionality is a powerful tool for automating processes and collecting data directly in your CRM. It allows you to:

  • Evaluate customer satisfaction.

  • Qualify leads.

  • Conduct internal assessments.

Here’s an example of how to set this up in your workspace:

First, create a Checkbox field, with each checkbox representing a value that needs to be selected. Then, create a Formula field that will calculate the total value based on the selected checkboxes.


What exactly should you enter in the Formula field?

Use the following formula:

= (if field("Are you satisfied with the service?") then 1 else 0) * 20 + (if field("Have you made a repeat purchase with us?") then 1 else 0) * 20 + (if field("Do you need help from our specialists?") then 1 else 0) * 20 + (if field("Are you in the country?") then 1 else 0) * 20 + (if field("Will you recommend us to others?") then 1 else 0) * 20


You can customize this setup to fit your specific workflow—for example, to better understand your customers and filter results based on scores or individual questions.

Here’s what the final result looks like:


​Lead Scoring

Lead scoring is a rating system that helps managers quickly determine how likely a lead is to become a customer. It allows you to focus your efforts on the most promising opportunities without spending time on leads that are less likely to convert.

In NetHunt CRM, you can automatically calculate this score using Survey fields and a Formula field.

How to Set It Up

First, create the fields that will store the information used to evaluate each lead.


I​n the Formula field you need to enter the following formula:
=(if field("Downloaded demo") then 20 else 0) + (if field("Attended webinar") then 20 else 0) + (if field("Company size") > 50 then 20 else 0) + (if field("Deal amount") > 2000 then 40 else 0)


Now, let’s review the values we obtained:


How to Extract Time or Date from a Text Date Format (Using Calendly as an Example)

When integrating with third-party services such as Calendly, the date and time may be passed to your CRM as a single text string in a complex format, for example: 2026-07-17T07:15:00.000000Z.

If you need to display only the meeting time in a separate field (for example, 07:15), you can automatically extract it using a text formula:


= _strings.substring(field("Calendly"), 11, 16)


​The resulting formula:


You can also extract the date in a clean format:
=_strings.substring(field("Calendly"), 8, 10) .. "." .. _strings.substring(field("Calendly"), 5, 7) .. "." .. _strings.substring(field("Calendly"), 0, 4)


The resulting formula:


How to Standardize Phone Numbers into One Format

This formula is designed to automatically standardize and format phone numbers into an international format.

The formula checks the first phone number in the list (field("Phone (technical)")[0]) and processes it according to the following rules:

  1. Empty value:
    If the field is empty (""), the formula returns an empty string ("").

  2. Already in the correct format (+):
    If the number already starts with +, it remains unchanged (e.g., +38093...+38093...).

  3. Replacing double zero:
    If the number starts with 00, this prefix is replaced with + (e.g., 0038093...+38093...).

  4. Adding + to the country code:
    If the number starts with 380 but does not have a +, the formula adds + at the beginning (e.g., 38093...+38093...).

  5. Formatting the local format (starting with 0):
    If the number is entered in local format (starts with 0), the first 0 is removed and the international code +380 is added (e.g., 0931234567+380931234567).

  6. Other cases:
    If the number does not match any of these conditions, the formula returns it in its original format.

    =if field("Phone (technical)")[0] == "" then "" else if _strings.substring(field("Phone (technical)")[0], 0, 1) == "+" then field("Phone (technical)")[0] else if _strings.substring(field("Phone (technical)")[0], 0, 2) == "00" then "+" .. _strings.substring(field("Phone (technical)")[0], 2) else if _strings.substring(field("Phone (technical)")[0], 0, 3) == "380" then "+" .. field("Phone (technical)")[0] else if _strings.substring(field("Phone (technical)")[0], 0, 1) == "0" then "+380" .. _strings.substring(field("Phone (technical)")[0], 1) else field("Phone (technical)")[0]


After that, you can create an automation to populate the Phone (technical) field and transfer the value from the Formula field to the main Phone field.


You can use the AI integration via MCP to simplify working with the Formula field. Simply start your request in the chat by mentioning that the formula is for NetHunt CRM, specify the field names, and describe the operations you need to perform between them.

The chat will suggest several formula options that you can copy and add to the Formula field in CRM, or the AI can create the formula directly for you.

If you are a developer or an integrator and have additional questions, such as what language the code is written in and what other queries this field supports, you can find documentation at this link.


Haven’t found the answers you’re looking for? Ask our Users Community.

Did this answer your question?