📖 Deep Dive · Formula Engine

SmartFormulaPRO — A Complete Guide to the Formula Engine

What is a formula engine, how does the DSL syntax work, and why do professionals choose it over spreadsheets? Covering all 51 built-in functions.

Contents

1. What Is a Formula Engine?

A formula engine is a system that stores and executes calculation logic independently from any spreadsheet or application interface. Instead of embedding formulas inside spreadsheet cells — where they are invisible, fragile, and hard to reuse — a formula engine lets you write calculation rules as named, portable definitions.

SmartFormulaPRO is a deterministic formula engine: given the same inputs, it always produces the same output. There are no hidden states, no volatile functions that recalculate unexpectedly, and no cell-reference chains that break when rows are inserted or deleted.

Key principle: Same input → always same output. No surprises, no silent errors, no version drift between colleagues.

The engine runs entirely on the user's device. No internet connection is required for writing formulas, running calculations, or browsing the saved library. Server communication happens only for login, cloud sync, and subscription verification.

Who Is It For?

SmartFormulaPRO targets professionals who perform repetitive domain-specific calculations: accountants, engineers (mechanical, electrical, civil), HR specialists, production planners, logistics coordinators, and anyone who currently relies on shared spreadsheet files or recalculates the same figures from scratch every time.

The engine is designed so that a non-programmer can write a complete multi-step calculation formula in under five minutes using only three symbols.


2. The Three Symbols — DSL Syntax

SmartFormulaPRO uses a minimal domain-specific language (DSL) built on three symbols. Every formula you write is a combination of these three building blocks:

?
Input

A value the user enters each time — a number, text, or date. The engine renders a labelled input field automatically.

@
Calculation

An intermediate variable. Calculations can reference inputs and other calculations. Never shown directly to the user unless you add an output for it.

#
Output

The result displayed on screen. An output references an input or a calculation and formats the final value.

Basic Example — VAT Calculator

// --- INPUTS --- ?Price (excl. VAT) [number] = price ?VAT Rate (%) [number] = vatRate // --- CALCULATIONS --- @VATAmount = price * (vatRate / 100) @TotalPrice = price + @VATAmount // --- OUTPUTS --- #VAT Amount = ROUND(@VATAmount, 2) #Total Price (incl. VAT) = ROUND(@TotalPrice, 2)

In this formula, the user fills in two fields (price and VAT rate). The engine computes two intermediate values, then displays two output cards with the results rounded to two decimal places.

Data Types

Each input declares its type inside square brackets:

Comments

Lines starting with // are comments and are ignored by the engine. Use them to organise long formulas into readable sections. Lines starting with //# hide a specific output card from view (Pro feature).

Dependency Resolution

The engine automatically resolves the correct execution order of @ calculations regardless of the order they appear in the formula text. If calculation @B depends on @A, the engine will always run @A first — even if you wrote @B before @A. Circular dependencies are detected and reported as errors.

Smart Dropdown

When a [text] input is compared to string constants inside an IF statement, the engine automatically generates a dropdown selector for that input field. The user picks from a list instead of typing — reducing errors and improving speed.

?Employee Category [text] = category @Bonus = IF(category == "Manager", salary * 0.20, IF(category == "Engineer", salary * 0.15, salary * 0.10)) #Bonus Amount = ROUND(@Bonus, 2)

The Employee Category field automatically becomes a dropdown with options: Manager, Engineer, and a default fallback.


3. All 51 Built-in Functions

The engine ships with 51 built-in functions across six categories. Functions on the Free plan (23) are listed first; Pro and above unlock all 51.

Mathematics — Free (14 functions)

FunctionDescription
ABS(n)Absolute value
ROUND(n, d)Round to d decimal places
CEILING(n)Round up to nearest integer
FLOOR(n)Round down to nearest integer
SQRT(n)Square root (n ≥ 0)
POWER(n, exp)n raised to the power of exp
SUM(a, b, ...)Sum of arguments
MAX(a, b, ...)Maximum of arguments
MIN(a, b, ...)Minimum of arguments
AVERAGE(a, b, ...)Arithmetic mean of arguments
COUNT(a, b, ...)Count of non-blank arguments
SIGN(n)Sign of n: −1, 0, or 1
RMS(a, b, ...)Root mean square
PI()Mathematical constant π (3.14159…)

Mathematics — Pro (4 functions)

FunctionDescription
LOG(n)Natural logarithm (base e)
LOG10(n)Logarithm base 10
LN(n)Natural logarithm (alias for LOG)
EXP(n)e raised to the power of n

Trigonometry — Pro (9 functions)

FunctionDescription
SIN(n)Sine (radians)
COS(n)Cosine (radians)
TAN(n)Tangent (radians)
ASIN(n)Arc sine — n must be in [−1, 1]
ACOS(n)Arc cosine — n must be in [−1, 1]
ATAN(n)Arc tangent
ATAN2(y, x)Arc tangent of y/x (four-quadrant)
RAD(deg)Degrees to radians
DEG(rad)Radians to degrees

Date — Free (2) + Pro (2)

FunctionPlanDescription
TODAY()FreeCurrent date (date only)
NOW()FreeCurrent date and time
YEAR(date) / MONTH(date) / DAY(date)FreeExtract year, month, or day from a date
DATEADD(date, n, unit)ProAdd n units ("D","M","Y") to a date
DATEDIFF(a, b, unit)ProDifference between two dates (a − b) in units

String — Free (5) + Pro (5)

FunctionPlanDescription
CONCAT(a, b, ...)FreeConcatenate strings
TOS(n)FreeConvert number to string
UPPER(s) / LOWER(s)FreeConvert case
TRIM(s)FreeRemove leading/trailing whitespace
LEN(s)FreeCharacter count
LEFT(s, n) / RIGHT(s, n)ProExtract n characters from start or end
MID(s, start, len)ProExtract substring from position
FIND(search, text)ProPosition of search string inside text
STRING_EQUAL(a, b)ProCase-insensitive string comparison
NORMALIZE(s)ProLowercase + trim (normalise before comparison)

Logic — Free (4 functions)

FunctionDescription
IF(cond, then, else)Conditional — supports nesting
NOT(cond)Logical negation
ISBLANK(v)True if value is empty or null
ISNUMBER(v)True if value is numeric

Advanced — Pro (1 function)

FunctionDescription
FACTORIAL(n)n! — n must be 0–170; decimals are floored

Not in the engine: CONTAINS, STARTS_WITH, ENDS_WITH, REPLACE, DATE_FORMAT, CEIL (use CEILING), LENGTH (use LEN). These are undefined and will produce an error if used.


4. Why Not a Spreadsheet?

Spreadsheets are excellent for exploratory data work, tables, and reports. But they have structural weaknesses when used as a formula library — a place where professionals store and reuse the same calculations repeatedly.

The Hidden-Formula Problem

In a spreadsheet, formulas live inside cells. They are invisible unless you click on the cell. A colleague receiving your file cannot audit what is being calculated without examining cell by cell. Formula logic is entangled with the data layout — move a row, break the formula.

In SmartFormulaPRO, the formula is the document. The logic is visible, named, and self-describing. There is no layout to break.

The Reuse Problem

Every time you need the same calculation in a new spreadsheet, you copy and paste cells — or try to remember the formula. Over time, multiple versions drift apart. SmartFormulaPRO stores each formula once in your cloud library. Open it, enter the inputs, get the result.

The Collaboration Problem

Shared spreadsheets suffer from concurrent editing conflicts, accidental formula overwrites, and version mismatches. SmartFormulaPRO formulas are owned by the individual user and synced to the cloud. The formula definition cannot be accidentally overwritten by a colleague's paste operation.

The Mobile Problem

Spreadsheet applications on mobile are functional but designed for desktop. SmartFormulaPRO's native Android app (and soon iOS) is purpose-built for on-site and field use: a clean input form, large calculate button, instant results — no panning across cells.

The Determinism Problem

Spreadsheets include volatile functions (NOW(), RAND(), INDIRECT()) that recalculate automatically and silently. In critical professional calculations — structural loads, payroll, tax — a result that changes by itself is dangerous. SmartFormulaPRO is deterministic: results change only when you change an input or click Calculate.


5. Editor Features

Syntax Highlighting

The editor colour-codes each element: ? inputs in pink, @ calculations in amber, # outputs in green, function names in orange, string literals in muted green, numbers in blue, comments in grey. The structure of a formula is readable at a glance.

Autocomplete

As you type, the editor suggests function names, variable aliases, and type hints. Press Tab or Enter to accept a suggestion. Autocomplete can be toggled off in Settings if you prefer a distraction-free environment.

Formula Formatter

One button standardises operator spacing, indentation, and alignment across the entire formula. Useful when sharing formulas with colleagues or when pasting formulas from other sources.

Contextual Hint Cards

When you type a ?, @, or # symbol for the first time, the editor shows a small inline card explaining syntax and data types. The card disappears after use and does not reappear for experienced users.

Error Highlighting

Errors are reported in real time. Division-by-zero highlights the zero-valued input field with an orange border. Undefined variables show underline warnings in the editor. Circular dependency errors identify which calculations form the loop.

Keyboard Shortcuts (Web)

Output Card Management (Pro+)

Drag and drop output cards to reorder them. Hide individual cards using the //#Label prefix — useful for internal calculations that produce intermediate results you don't want cluttering the result view. At least one card must remain visible.


6. Platform Support

PlatformStatusNotes
Web (Chrome, Safari, Firefox, Edge)✅ Activeapp.smartformulapro.com — no installation required
Android✅ ActiveGoogle Play — v8.5.3
iOS⏳ Coming soonInfrastructure ready; App Store submission pending
macOS Desktop⚙️ Private buildElectron wrapper — not on the App Store

All platforms share the same calculation engine and the same cloud library. A formula saved on Android is immediately available on the web — and vice versa.

Offline Access

Calculation runs entirely on the device. Your saved formula library is cached locally. You can write formulas, run calculations, and browse your library without an internet connection. Paid plan users retain full access for 7 days without internet before the plan falls back to Free.

Authentication

Sign in with Email + Password or Google Sign-In (Web and Android). Apple Sign-In will be available when the iOS app launches. You can use the formula engine without an account — saved library and cloud sync require a free account.

Export Options


7. Pricing & Plans

SmartFormulaPRO follows a usage-based tier model. Formulas are never deleted when a subscription ends — they become locked (read-only) if they exceed the Free plan limits.

LimitFreeProPremiumEnterprise
Saved formulas2120250500
Characters per formula5004,0008,00015,000
Inputs per formula5UnlimitedUnlimitedUnlimited
Outputs per formula3UnlimitedUnlimitedUnlimited
Functions23515151

For current pricing, visit smartformulapro.com.

Subscriptions are available monthly and annually. Payment is processed through Google Play (Android) and the Apple App Store (iOS). There are no lifetime plans.

What is not included in any plan: Priority support, 24/7 support, unlimited formula count, or a money-back guarantee is not offered. The product is designed for self-service professional use with a comprehensive built-in help system in 7 languages.