FormulaScript Overview
What is FormulaScript?
FormulaScript is a formula language based on Microsoft Excel. If you've written Excel formulas, you already know FormulaScript — it uses the same syntax, operators, and function names.
ConvertSite supports nearly all Excel functions, including math (SUM, ROUND), text (CONCAT, UPPER, LOWER), date (TODAY, DATEADD), logical (IF, AND, OR), and financial (PMT, FV, PV).
Use FormulaScript in your forms and calculators to calculate prices, validate inputs, transform data, and create conditional logic based on user responses.
If you can write an Excel formula, you can write a FormulaScript formula. Search for any Excel function name to see if ConvertSite supports it.
Basic Building Blocks
Numbers
Numbers can be whole or fractional. Use a period as the decimal separator:
42
3.14
.23 // Same as 0.23
1_000_000 // Underscores for readabilityText (Strings)
Text values are enclosed in single or double quotes. Combine text with the & operator:
"Hello World"
'It works!'
"Hello " & "World" // = "Hello World"True/False (Booleans)
Booleans represent yes/no values:
TRUE
FALSE
1 // Also TRUE
0 // Also FALSEOperators
Arithmetic
FormulaScript supports standard math operators:
1 + 2 // = 3
3 * (1 + 2) // = 9 (brackets change order)
2 ^ 3 // = 8 (exponent)
10 / 2 // = 5Comparisons
Compare values to check conditions. Results are TRUE or FALSE:
Operator | Meaning | Example |
|---|---|---|
| Greater than |
|
| Less than |
|
| Greater than or equal |
|
| Less than or equal |
|
| Equal to |
|
| Not equal to |
|
Text can only be compared for equality or inequality, not greater/less than.
Use Values from Your Form
Reference values from your form elements by their name. A common reference is QA, the default name for the first question:
QA // Returns the value of QA
QA * 5 // Multiply QA by 5
IF(QA > 100, "High", "Low")Every FormulaScript feature accepts references. Use them to make formulas respond dynamically to user input.
Functions
Call functions the same way you do in Excel — with parentheses and comma-separated arguments:
SUM(10, 20, 30) // = 60
ROUND(3.14159, 2) // = 3.14
IF(QA > 100, "High", "Low")Function names are case-insensitive: SUM, Sum, and sum all work.
Common Functions
Function | Purpose | Example |
|---|---|---|
| Conditional logic |
|
| Add values |
|
| Round to decimals |
|
| Join text |
|
| Absolute value |
|
| Find smallest/largest |
|
Explore the function categories for the complete list:
Math Functions
Text Functions
Logical Functions
Date Functions
Financial Functions
Comments
Add comments to explain your formulas. Comments start with //:
// Calculate total with discount
IF(QA > 100, QA * 0.9, QA) // 10% off for orders over 100Error Messages
When something goes wrong, FormulaScript displays #ERROR! with a message:
Error | Cause | Fix |
|---|---|---|
Division by zero | Dividing by 0 | Add a conditional check or use IFERROR |
Unknown variable 'X' | Reference not defined | Check element names in your form |
Expected N arguments | Wrong number of parameters | Check the function signature |
Unexpected token | Syntax error | Check for unmatched parentheses or typos |
Next Steps
Learn about intermediate results, pipes, and format strings in Advanced FormulaScript.