---
schema_version: "1"
id: 08522d693488ae001fae55a7ef2a375689f3ecefe6a358ad949e7d3fbd7788c3
title: Formula Operators
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/mktg/264-0-0/mcidp_data_mapping_operators.md
canonical_url: https://help.salesforce.com/s/articleView?id=mktg.mcidp_data_mapping_operators.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 194d9dd50f2044fe771a9a12db238197982dd906099ffb8e4e6121c037c9ca8e
description: A formula is a mathematical relationship or rule expressed in symbols. With Marketing Cloud Intelligence Data Pipelines, you can use formulas to create calculated measurements and dimensions when mapping your data. Operators specify the type of calculation to perform on the terms in a formula—such as addition, subtraction, multiplication, or division.
products:
  - Marketing
  - Marketing Cloud Intelligence
release: "264"
---
# Formula Operators

A formula is a mathematical relationship or rule expressed in symbols. With Marketing Cloud Intelligence Data Pipelines, you can use formulas to create calculated measurements and dimensions when mapping your data. Operators specify the type of calculation to perform on the terms in a formula—such as addition, subtraction, multiplication, or division.

There are several types of formula operators available in MDP, as shown in the following tables:

**Comparison Operators**

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:25%">
          <col style="width:25%">
          <col style="width:25%">
          <col style="width:25%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d14819e51">Operator Symbol</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d14819e54">Operator Name </th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d14819e57">Description</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d14819e60">Example</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Operator Symbol" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e51 ">==</td>

            <td data-label="Operator Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e54 ">Equal</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e57 ">Checks to see if the values on both sides of the operator are equal.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e60 ">
              <p>"Foo" == "Foo"</p>
              <p style="margin-bottom:0;"> is true</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Operator Symbol" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e51 ">
              <p style="margin-bottom:0;">!=</p>
            </td>

            <td data-label="Operator Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e54 ">Not Equal</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e57 ">Checks to see if the values on both sides of the operator are not
              equal.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e60 ">
              <p>"foo" != "bar" </p>
              <p style="margin-bottom:0;">is true</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Operator Symbol" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e51 ">
              <p style="margin-bottom:0;">&gt;</p>
            </td>

            <td data-label="Operator Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e54 ">Greater Than</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e57 ">Checks to see if the value on the left side of the operator is greater than
              the value on the right.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e60 ">
              <p>2 &gt; 1</p>
              <p style="margin-bottom:0;"> is true </p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Operator Symbol" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e51 ">&lt;</td>

            <td data-label="Operator Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e54 ">Less Than</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e57 ">Checks to see if the value on the left of the operator is less than the
              value on the right side. </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e60 ">
              <p>1&lt;2</p>
              <p style="margin-bottom:0;">is true </p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Operator Symbol" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e51 ">&gt;=</td>

            <td data-label="Operator Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e54 ">Greater Than or Equal to </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e57 ">Checks to see if the value on the left side of the operator is greater than
              or equal to the value on the right side.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e60 ">
              <p>1 &gt;= 1</p>
              <p> is true </p>
              <p>6 &gt;= 5</p>
              <p style="margin-bottom:0;">is true</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Operator Symbol" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e51 ">&lt;=</td>

            <td data-label="Operator Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e54 ">Less Than or Equal to</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e57 ">Checks to see if the value on the left side is less than or equal to the
              value on the right.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e60 ">
              <p>2 &lt;= 2 </p>
              <p>is true </p>
              <p>2 &lt;= 3</p>
              <p style="margin-bottom:0;">is true</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Operator Symbol" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e51 ">Contains</td>

            <td data-label="Operator Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e54 ">Value Containment Check</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e57 ">Checks to see if the value on the left contains the value on the
              right.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e60 ">“Foo” var contains "Foo"</td>

          </tr>
          <tr class="">
            <td data-label="Operator Symbol" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e51 ">Soundslike</td>

            <td data-label="Operator Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e54 ">Soundex Check</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e57 ">Performs a <a href="https://en.wikipedia.org/wiki/Soundex#:~:text=Soundex%20is%20a%20phonetic%20algorithm,despite%20minor%20differences%20in%20spelling." target="_blank">Soundex</a> comparison between two strings. Allows you to
              search by sound key, when you know the pronunciation but not the spelling.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e60 ">"foobar" soundslike "fubar"</td>

          </tr>
        </tbody>
      </table>

**Logical Operators**

   
| Operator Symbol | Operator Name | Description | Example |
| --- | --- | --- | --- |
| && | Logical AND | Checks to see that the values on both sides of the operator are true. | foo && bar |
| || | Logical OR | Checks to see if either the value on the left or the right is true. | foo || bar |
| or | Logical OR | Checks a sequence of values for emptiness and returns the first non-empty value. (This operator, or at least its equivalent functionality, is referred to as the "elves operator" in other languages) | foo or bar or barfoo or 'N/A' |
| ~= | Regular Expression Match | Checks to see if the value on the left matches the regular expression on the right. | foo ~= '\[a-z\].+' |

**Bitwise Operators**

   
| Operator Symbol | Operator Name | Description | Example |
| --- | --- | --- | --- |
| & | Bitwise AND | The & operator compares each binary digit of two integers and returns a new integer, with a 1 wherever both numbers had a 1 and a 0 anywhere else | Foo & 5 |
| | | Bitwise OR | The | operator compares each binary digit across two integers and gives back a 1 if either of them is 1. | Foo | 5 |
| ^ | Bitwise XOR | When calculating the resulting number, it again compares the binary digits of these numbers. If one or the other is a 1, it inserts a 1 into the result, otherwise, it will insert a 0. | Foo ^ 5 |

**Arithmetic Operators**

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:25%">
          <col style="width:25%">
          <col style="width:25%">
          <col style="width:25%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d14819e471">Operator Symbol</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d14819e474">Operator Name</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d14819e477">Description</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d14819e480">Example</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Operator Symbol" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e471 ">+</td>

            <td data-label="Operator Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e474 ">Addition</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e477 ">
              <p>Adds the value on the left to the value on the right</p>
              <p style="margin-bottom:0;">Note: When Mapping it must be used in conjunction with the NUMBER() formula, as
                in the mapping, + is used for concatenation</p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e480 ">
              <p>1 + 2</p>
              <p style="margin-bottom:0;">Returns: 3</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Operator Symbol" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e471 ">-</td>

            <td data-label="Operator Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e474 ">Subtraction.</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e477 ">Subtracts the value on the right from the value on the left.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e480 ">
              <p>2 - 1</p>
              <p style="margin-bottom:0;">Returns: 1</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Operator Symbol" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e471 ">/</td>

            <td data-label="Operator Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e474 ">Division</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e477 ">Divides the number on the left by the number on the right</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e480 ">
              <p>2 / 1</p>
              <p style="margin-bottom:0;">Returns: 2</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Operator Symbol" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e471 ">*</td>

            <td data-label="Operator Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e474 ">Multiplication </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e477 ">Multiplies the number on the left by the number on the right</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e480 ">
              <p>2 * 1</p>
              <p style="margin-bottom:0;">Returns: 2</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Operator Symbol" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e471 ">%</td>

            <td data-label="Operator Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e474 ">Modulus</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e477 ">Divides the number on the left by the number on the right and returns the
              remainder.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e480 ">
              <p>1 % 2</p>
              <p style="margin-bottom:0;">Returns: 1</p>
            </td>

          </tr>
        </tbody>
      </table>

**Other Operators**

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:25%">
          <col style="width:25%">
          <col style="width:25%">
          <col style="width:25%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d14819e627">Operator Symbol</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d14819e630">Operator Name </th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d14819e633">Description </th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d14819e636">Example </th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Operator Symbol" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e627 ">+</td>

            <td data-label="Operator Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e630 ">String Concatenation</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e633 ">
              <p>Concatenation is the process of appending one string to the end of another
                string</p>
              <p style="margin-bottom:0;">Note: In Calculated Measurements, + is used for addition (see explanation in Arithmetic
                Operators)</p>
            </td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e636 ">
              <p>'foo' + 'bar'</p>
              <p style="margin-bottom:0;">Returns: 'foobar'</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Operator Symbol" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e627 ">#</td>

            <td data-label="Operator Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e630 ">Concatenation Operator</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e633 ">Concatenates two literals as strings.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e636 ">
              <p>1 # 2 </p>
              <p style="margin-bottom:0;">returns: '12'</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Operator Symbol" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e627 ">=</td>

            <td data-label="Operator Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e630 ">Assignment</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e633 ">Assigns the value on the right to the variable on the left.</td>

            <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d14819e636 ">var = 'foobar'</td>

          </tr>
        </tbody>
      </table>