Creating a Calculator with Formula Fields (Without G-Sheet) #
In this guide, we’ll show you how to create a calculator directly within the ES Calculator Builder using built-in formula fields, without needing a Google Sheet. We’ll take the example of a Bitcoin Trading Calculator, which calculates the total investment, selling value, total fees, and net profit based on user inputs.
Example Overview #
The Bitcoin Trading Calculator will include the following inputs:
- Buy Price: The price at which Bitcoin was purchased.
- Sell Price: The price at which Bitcoin is being sold.
- Bitcoin Quantity: The amount of Bitcoin being bought or sold.
- Trading Fee (%): The percentage fee charged for each trade (both buying and selling).
The calculator will output:
- Total Investment: The initial amount spent to buy the Bitcoin.
- Total Selling Value: The total value received from selling the Bitcoin.
- Total Fees: The sum of the fees for buying and selling.
- Net Profit: The profit (or loss) after considering the total investment, selling value, and fees.
Step-by-Step Guide #
Step 1: Create a New Calculator #
Log in to the ES Calculator Builder and click on Create New Calculator.
Go to “Appearance & Settings > Calculation Settings > Google Sheet Required?” and select No to turn off the Google Sheet requirement.
Step 2: Add Input Fields #
Navigate to the Add Elements tab and drag and drop the following input fields:
- Slider Field for “Buy Price” (user enters the purchase price per Bitcoin). Set input ID to buy_price.
- Slider Field for “Sell Price” (user enters the selling price per Bitcoin). Set input ID to sell_price.
- Input Field for “Bitcoin Quantity” (user enters the amount of Bitcoin). Set input ID to quantity.
- Input Field for “Trading Fee (%)” (user enters the percentage fee applied to each trade). Set input ID to fee.
Step 3: Configure Result Fields #
Drag and drop formula field elements into the result area. Use the IDs of your input fields to create the following formulas. Assign a unique ID to each formula field to use them in subsequent calculations:
- Total Investment: (set ID investment)
= buy_price * quantity
- Total Selling Value: (set ID selling_value)
= sell_price * quantity
- Total Fees: (set ID total_fees)
= ( (investment + selling_value) * fee ) / 100
- Net Profit: (set ID net_profit)
= (selling_value - investment) - total_fees
It is essential to assign unique IDs to formula fields in both the input and result sections of the calculator builder. For example, in this guide, the “Total Selling Value” is used to calculate “Total Fees.” The formula for “Total Fees” accesses the value of “Total Selling Value” through its ID, “selling_value.” Similarly, the field with the ID “total_fees” is used in the calculation of “Net Profit.”
Step 4: Customize Appearance and Settings #
Go to the Appearance & Settings tab to adjust the number formatting (EU/US) for input fields, customize the calculator’s width, layout, and more.
For a full list of all Appearance and Settings options, read more here: Setting Calculator Layout, Shadow, and Theme Colors.
Step 5: Preview and Publish Your Calculator #
Use the preview option to test your calculator. Enter different values in the input fields to ensure the results update as expected.
Once you are happy with the setup, click Embed to generate the embed code, and add it to your website where you want the Bitcoin Trading Calculator to appear.
Summary #
Using formula fields in the ES Calculator Builder allows you to create dynamic calculators without needing a Google Sheet. This example of a Bitcoin Trading Calculator demonstrates how to handle various inputs and calculations directly within the builder. You can use this method for a wide range of use cases, from simple calculations to more complex scenarios, all without external sheets.
Feel free to adjust the formulas and fields according to your needs and reach out if you encounter any issues while setting up your calculator!