# How to build a calculator

You create the form fields by typing their properties, one field on a line. (The label and the step are optional; step defaults to 1) There are 5 form fields available:

• Number or Slider

``` number label="This is a number field" min=0 max=100 value=20 step=3 ```

or

``` slider label="This is a Slider field" min=-200 max=200 value=20 step=1.5 ```

• Checkbox or Radio or Dropdown

The "values" property contains a comma separated list of "Label"/value pairs

``` checkbox label="What are your favorite TV shows?" values="Friends"/50,"Seinfeld"/80,"M.A.S.H."/100 ```

or

``` radio label="Is your house facing South?" values="Yes"/100,"No"/0 ```

or

``` select label="Where do you live?" values="London"/100,"Paris"/80,"Lisbon"/200 ```

In the formula section (under the fields section) add formulas in the following format:

``` Write any text here, formulas go inside the curly brackets: {Q1+Q2/10} ```

Anything inside curly brackets will get parsed as an Excel formula, using Q1, Q2, etc as the values for Question 1, 2, etc

You can even use variables. First you declare the variable on a separate line:

``` V1 = {Q1+50} ```

You can use V1, V2, V_123 or V_abc etc

Then you can use that variable in formulas:

``` Your income is: {V1 * 1000} ```

You can use Markdown to enhance the text, including formulas, for example to make a formula result bold:

``` Optional text here: **{(Q1-50)/100}** ```

## Here's how you use IF

Let's say Q1 asks for age. Inside the brackets {} you will write the IF statement like this:

``` { IF(condition, value_if_true, value_if_false) } ``` ``` You are: { IF(Q1>50,"Old","Young") } ``` You can also use AND for multiple conditions: ``` { IF( AND(Q1>50, Q2>10), Q3, 100) } ```

After you save your calculator you will get a permanent link where it is published and a code you can use to add the calculator to your website

For any questions, ideas or bug reports just use the "Feedback" link at the bottom of the page

Feedback × Need to ask something or report an issue? Thanks! We'll be back with a reply soon.