- 3 Minutes to read

- Print
- DarkLight
- PDF

# Formula Fields

- 3 Minutes to read

- Print
- DarkLight
- PDF

Let MainEvent Formula Fields do the math for you. Adding a formula field to your recap definition will multiply your odds of getting accurate calculations exponentially. Formula fields allow you to plug in certain recap questions and perform automatic calculations. Interested in doing less manual math? Let’s get started.

### Creating a Formula Field

If you don’t know how to build standard recap fields and definitions, stop! We have a different document for you to look at first. You can find that here (include link to recap doc).

Formula fields must be used with other recap fields, not as a standalone question. A formula field is built off the responses received from other integer based questions. Want to know the total number of samples distributed at an event? Want to know the average rating for an event? Once a rep has submitted responses, the formula field will pull their responses and calculate the answer for you.

For the sake of this document, we’ll be editing an existing recap. You may also wish to add a formula field to a new recap, which is totally fine, just ensure that the questions you want to use for the formula have already been added since formula fields are built off the responses to those questions. To begin creating a formula field, click **Recaps** and select **Fields**.

This will load the Recap Field Index. This page will list all the previously existing recap fields on the client. Click **Add New Recap Field **in the upper right of the page.

Now you’re looking at the Field Details page. This is where you’ll create the formula field. First thing you want to do is add a name. Then from the Type dropdown, select **Formula. **

Now’s when things start to get interesting. A whole new section, imaginatively called Formula has suddenly appeared as if by magic! (Or, you know, a select menu…). At this point, you need to know the basics behind order of operations (BEDMAS, if you will), and also, you need to know what your formula is going to be.

We’re now going to go over the ways you can build a formula.

##### Math First and Questions Later

Let’s say you have a recap question that you need to perform a certain calculation on to retrieve useful information. Like you have to multiply by something to determine the reach. You can do that.

Begin typing the numbers after the = sign. Then, search for the recap field in the Search Custom Fields section. Typing in keywords will auto-populate. Just drag and drop the question into the formula.

Save the formula by clicking **Submit**.

Now, let’s add that to a recap. Pull up the recap you want to add the formula field to by clicking **Recaps** in the navigation menu, and selecting** Definitions**. Once the Recap Definition Index has loaded, click the **wrench icon. **Again, if you need assistance with creating a recap definition, we have a document for that here.

then

Now you’re looking at your recap definition. What we need to do now is decide where in the recap you want the question, and to find the formula field. To find the recap field, you have a couple of options. You can do a Quick Search for the field name under Available Recap Fields.

You can also locate the question in the list of available fields.

Whatever method you pick, your next steps will be the same. Drag and drop the field into the recap definition where you want it. This can be adjusted by just dragging and dropping the question again, so no pressure here.

Got it where you want it? Great, now click **Save** in the upper right of the page.

### Questions Using Questions

New scenario. You’ve got a formula in which one question is dependent on another question for the math to happen. We can do that.

Let’s say we’re averaging out two weighted field ratings. So we begin with a bracket. Then add the first field, a **+**, and the second question. Now let’s close that bracket up. Now we can divide by adding a **/**. In our scenario, we’re dividing by 2, but you do what you need to do. (Multiplication is done by placing a *** **before the multiplier). Our formula now looks like this:

So, using order of operations, our formula is (Q1+Q2) /2. We can move any of these functions around if we needed, based on the desired outcome of the formula.

When you add your formula to a recap definition, as the questions are answered, the math will do itself.