### Example URL with Multiple Query Parameters Source: https://www.convertcalculator.com/help/building/set-question-defaults-with-query-parameters When using multiple query parameters, separate them with the '&' symbol. This example shows pre-filling both an email address and a name. ```html https://www.bananastand.com/banana-calculator?emailaddress=michaelbluth@bluthcompany.com&name=Micheal ``` -------------------------------- ### Example URL with Email Query Parameter Source: https://www.convertcalculator.com/help/building/set-question-defaults-with-query-parameters This is an example of a URL with a query parameter to pre-fill an email address field. Ensure the query parameter name matches the setting in your calculator. ```html https://www.bananastand.com/banana-calculator?emailaddress=michaelbluth@bluthcompany.com ``` -------------------------------- ### INDEX Function with Table Reference Source: https://www.convertcalculator.com/help/functions/index-function Example of using the INDEX function to retrieve a value from a table. Column indexes start at 0. ```FS INDEX(TABLE(TA), 2, 0) ``` -------------------------------- ### COUPON Function Example with Equation and Coupon Data Source: https://www.convertcalculator.com/help/functions/coupon-function Shows an example of the COUPON function used within a formula to apply a discount to a calculated 'Total price'. The coupon data is referenced using a question reference followed by a data reference in curly brackets. ```plaintext FS COUPON(QA + QB, QC{data}) ``` -------------------------------- ### Basic IF() Function Example Source: https://www.convertcalculator.com/help/functions/if-function A simple example demonstrating the IF() function in the formula builder. It checks if QA is greater than 50 and returns QB * 2 if true, otherwise 'N/A'. ```FS IF(QA > 50, QB * 2, "N/A") ``` -------------------------------- ### Choose an item from a list Source: https://www.convertcalculator.com/help/functions/choose-function This example shows how to select 'Item2' from a list of three items using the CHOOSE function. ```FS CHOOSE(2, "Item1", "Item2", "Item3") ``` -------------------------------- ### Yes/No Query Parameter Example Source: https://www.convertcalculator.com/help/building/set-question-defaults-with-query-parameters Use '1' for 'Yes' and '0' for 'No' in 'Yes/No' questions. ```text ?wants-newsletter=1 ``` -------------------------------- ### Choose a value using references Source: https://www.convertcalculator.com/help/functions/choose-function This example demonstrates using references (QA, DA_A) as values within the CHOOSE function. ```FS CHOOSE(QA, DA_A) ``` -------------------------------- ### TABLEFINDMANY Example Usage Source: https://www.convertcalculator.com/help/functions/table-functions Example of using TABLEFINDMANY to search for rows matching an email address in a specific table and column, sorted by another column. The function returns all matching rows as a table. ```FS TABLEFINDMANY(TA, A, your@email.com, B, 1) ``` -------------------------------- ### Email Query Parameter Example Source: https://www.convertcalculator.com/help/building/set-question-defaults-with-query-parameters Use a standard email format for 'Email' questions. ```text ?emailaddress=michael@bluthcompany.com ``` -------------------------------- ### Time Query Parameter Example Source: https://www.convertcalculator.com/help/building/set-question-defaults-with-query-parameters Use the 'HH:mm' (24-hour) format for 'Time' questions. ```text ?start-time=22:23 ``` -------------------------------- ### Date Query Parameter Example Source: https://www.convertcalculator.com/help/building/set-question-defaults-with-query-parameters Use the 'yyyy-mm-dd' format for 'Date' questions. ```text ?start-date=2021-08-01 ``` -------------------------------- ### DISTANCE() Examples Source: https://www.convertcalculator.com/help/functions/distance-functions Demonstrates how to use the DISTANCE function with raw coordinates or by referencing Place-question outputs for latitude and longitude. The unit parameter accepts 'm', 'ft', 'km', 'mi', 'in'. ```FS DISTANCE(51.91670188501261, 4.488032213665693, 51.89402927794878, 4.52355382345693, "mi") ``` ```FS DISTANCE(51.91670188501261, 4.488032213665693, QA_lat, QA_lng, "mi") ``` ```FS DISTANCE(51.91670188501261, 4.488032213665693, QA_latitude, QA_longitude, "mi") ``` -------------------------------- ### HLOOKUP Exact Match Example Source: https://www.convertcalculator.com/help/building/formulas/using-datasheets/hlookup-function Example of using HLOOKUP to find an exact match for 'Question A' in the first row of 'Datasheet A' and retrieve a value from the second row (index 1). ```formulascript HLOOKUP(QA, DA, 1, 1) ``` -------------------------------- ### Number Query Parameter Example Source: https://www.convertcalculator.com/help/building/set-question-defaults-with-query-parameters Use a plain number for the 'Number' question type. ```text ?price=80 ``` -------------------------------- ### Using Values from Another Calculator via Query Parameters Source: https://www.convertcalculator.com/help/building/set-question-defaults-with-query-parameters This example demonstrates how to use values from formulas within another calculator by embedding them as query parameters. The `{{#formula}} {{/formula}}` syntax is required for these values. ```html https://app.convertcalculator.co/to/wHM9cHcf5acAcj8Qu?area={{#formula}}VA{{/formula}}&email={{#formula}}QB{label}{{/formula}} ``` -------------------------------- ### Radio Button Query Parameter Example Source: https://www.convertcalculator.com/help/building/set-question-defaults-with-query-parameters For 'Radio' questions, use the value of the option. Ensure only one option has this specific value. ```text ?option=30 ``` -------------------------------- ### FINDIFS with Text Criteria Source: https://www.convertcalculator.com/help/building/formulas/using-datasheets/findifs-function Example of using FINDIFS with text criteria to find a value. ```FS FINDIFS(DA_C, DA_A, QA, DA_B, QB) ``` -------------------------------- ### Text Field Query Parameter Example Source: https://www.convertcalculator.com/help/building/set-question-defaults-with-query-parameters Use plain text for 'Text Field' questions. Spaces can be represented by '+'. ```text ?name=Michael+Bluth ``` -------------------------------- ### IF() Function for Max Value Source: https://www.convertcalculator.com/help/functions/if-function This example uses the IF() function to return the larger of two values, QA or QB. ```FS IF(QA > QB, QA, QB) ``` -------------------------------- ### FINDIFS with Numeric Criteria Source: https://www.convertcalculator.com/help/building/formulas/using-datasheets/findifs-function Example of using FINDIFS with numeric criteria to find a value. ```FS FINDIFS(DA_C, DA_A, 1, DA_B, 2) ``` -------------------------------- ### IFS Function Usage Example Source: https://www.convertcalculator.com/help/functions/ifs-function Demonstrates how to use the IFS function to return different values (VA, VB, VC) based on whether the value of QA is less than 1, 5, or 10, respectively. The first condition met determines the output. ```formula IFS( QA < 1, VA, QA < 5, VB, QA < 10, VC ) ``` -------------------------------- ### Simple Formula Example Source: https://www.convertcalculator.com/help/building/formulas A basic formula multiplying a question's value by 100 and adding 100. The formula updates automatically when the question's value changes. ```Formula FS QA * 100 + 100 ``` -------------------------------- ### INDEX Function with One-Dimensional Array Source: https://www.convertcalculator.com/help/functions/index-function Example of using the INDEX function to retrieve a value from a one-dimensional array by its position. ```FS INDEX( ARRAY(1, 2, 3, 4, "five"), 4) ``` -------------------------------- ### Snipcart HTML Setup Source: https://www.convertcalculator.com/help/integrations/integrate-with-snipcart Add these lines to the head of your page to include Snipcart's CSS, a hidden div for Snipcart's core, and the Snipcart JavaScript library. ```html
``` -------------------------------- ### Dates Range Query Parameter Example Source: https://www.convertcalculator.com/help/building/set-question-defaults-with-query-parameters For date ranges, use the 'yyyy-mm-dd' format and separate the two dates with a '|' symbol. ```text ?timeframe=1999-09-01|2021-09-01 ``` -------------------------------- ### Get Current Date and Time - NOW() Source: https://www.convertcalculator.com/help/functions/date-functions Returns the current date and time as a serial number. The date is based on UTC time and requires no arguments. ```plaintext NOW() ``` -------------------------------- ### Show or Hide Image Layers with Formulas Source: https://www.convertcalculator.com/help/elements/layered-images-result Formulas determine layer visibility. A value (like 1 or TRUE) shows the layer, while FALSE or 0 hides it. Use these examples to control layer display based on question values. ```Formula // If QA is bigger than 50, show layer, otherwise hide it IF(QA > 50, 1, 0) ``` ```Formula QA < 50 ``` ```Formula // If QA = 1 and QB = 2, show layer, otherwise hide it AND(QA = 1, QB = 2) ``` ```Formula // If QB = 1, show layer, otherwise hide it IF(QB, TRUE, FALSE) ``` -------------------------------- ### IF Function Example Source: https://www.convertcalculator.com/help/building/formulas Demonstrates the use of the IF function within a formula to perform conditional calculations. If QA is greater than 50, it doubles QA; otherwise, it returns 0. ```Formula IF(QA > 50, QA * 2, 0) ``` -------------------------------- ### DATEDIF() Function Syntax Source: https://www.convertcalculator.com/help/functions/datedif The basic syntax for the DATEDIF() function, including its parameters: start date, end date, and timeframe. ```plaintext DATEDIF(date1, date2, timeframe) ``` -------------------------------- ### FINDIFS with GOOGLESHEET Data Source: https://www.convertcalculator.com/help/functions/googlesheet-function Demonstrates using FINDIFS with data from GOOGLESHEET. It requires creating a variable for the spreadsheet data and referencing columns using COLUMN(VA, index). Column indexing starts at 0. ```FS VA = GOOGLESHEET("spreadsheet_id", "sheet_id") FINDIFS(COLUMN(VA, 2), COLUMN(VA, 0), QA, COLUMN(VA, 1), QB) ``` -------------------------------- ### Apply Cleaning Frequency Discount Source: https://www.convertcalculator.com/help/tutorials/cleaning-business-price-quote-calculator Multiply the room price by the discount value 'QB' from the cleaning frequency question to apply the discount. ```Formula QA * QB ``` -------------------------------- ### HLOOKUP Approximate Match Example Source: https://www.convertcalculator.com/help/building/formulas/using-datasheets/hlookup-function Example of using HLOOKUP to find a value (180) in the first row of 'Datasheet B' and retrieve a value from the third row (index 2), using a range lookup. ```formulascript HLOOKUP(180, DB, 2, 2) ``` -------------------------------- ### SUMIFS with Text Criteria Source: https://www.convertcalculator.com/help/functions/sumifs-function Example of using SUMIFS with text criteria for summing values. ```Formula FS SUMIFS(DA_C, DA_A, QA, DA_B, QB) ``` -------------------------------- ### COUPON Function Sample Usage with Variable Source: https://www.convertcalculator.com/help/functions/coupon-function Illustrates a sample usage of the COUPON function where the first argument is a variable. ```plaintext FS COUPON(VA, QC{data}) ``` -------------------------------- ### SUMIFS with Numeric Criteria Source: https://www.convertcalculator.com/help/functions/sumifs-function Example of using SUMIFS with numerical criteria for summing values. ```Formula FS SUMIFS(DA_C, DA_A, 1, DA_B, 2) ``` -------------------------------- ### Convert a fixed amount using variables for currencies Source: https://www.convertcalculator.com/help/functions/convertcurrency-function This snippet shows how to convert a fixed amount (100) using variables (QA and QB) to specify the base and target currencies. ```FS CONVERTCURRENCY(100, QA, QB) ``` -------------------------------- ### CHOOSE Function Syntax Source: https://www.convertcalculator.com/help/functions/choose-function The general syntax for the CHOOSE function, showing the index number and subsequent values. ```FS CHOOSE (index_num, value1, [value2], ...) ``` -------------------------------- ### COUPON Function Sample Usage with Fixed Value Source: https://www.convertcalculator.com/help/functions/coupon-function Demonstrates a sample usage of the COUPON function where the first argument is a fixed numerical value. ```plaintext FS COUPON(100, QA{data}) ``` -------------------------------- ### Using a Datasheet for Options Source: https://www.convertcalculator.com/help/building/options-from-formula This formula retrieves options directly from a datasheet (DA). ```FS FS DA ``` -------------------------------- ### SUMIFS Function Syntax Source: https://www.convertcalculator.com/help/building/formulas/using-datasheets/sumifs-function Illustrates the general syntax for the SUMIFS function, including optional criteria pairs. ```formulas SUMIFS(find_column_reference, criteria_column_reference1, criterion1, [criteria_column_reference2, criterion2, …]) ``` -------------------------------- ### Calculate Complete Years Between Dates Source: https://www.convertcalculator.com/help/functions/datedif Use the 'Y' timeframe to get the number of complete years in the period between two dates. ```plaintext DATEDIF(01/01/2001, 01/01/2002, "Y") = 1 ``` -------------------------------- ### Calculate Days Between Dates Source: https://www.convertcalculator.com/help/functions/datedif Use the 'D' timeframe to get the number of complete days in the period between two dates. ```plaintext DATEDIF(01/01/2001, 01/01/2002, "D") = 365 ``` -------------------------------- ### Namespace and Basic Container Source: https://www.convertcalculator.com/help/styling/custom-css Use the '.cc' namespace to scope your custom styles. The '.cc__flex-container' and '.cc__box' classes are for general layout. ```CSS // Namespace (use this to scope rules) .cc {} ``` ```CSS // Flexbox container .cc__flex-container // Flexbox column .cc__box {} ``` -------------------------------- ### FINDIFS Function Syntax Source: https://www.convertcalculator.com/help/building/formulas/using-datasheets/findifs-function Illustrates the general syntax for the FINDIFS function, including optional additional criteria. ```FS FINDIFS(find_column_reference, criteria_column_reference1, criterion1, [criteria_column_reference2, criterion2, …]) ``` -------------------------------- ### Global Script for Synchronous Loading Source: https://www.convertcalculator.com/help/embedding Use this script in the `` section for synchronous loading, recommended when the calculator is immediately visible to limit loading time after the page loads. ```HTML ``` -------------------------------- ### Calculate Days Difference (Ignoring Months) Source: https://www.convertcalculator.com/help/functions/datedif Use the 'YD' timeframe to get the difference in days, disregarding the months in the period. ```plaintext DATEDIF(01/01/2001, 30/06/2002, "YD") = 180 ``` -------------------------------- ### Calculate Complete Months Between Dates Source: https://www.convertcalculator.com/help/functions/datedif Use the 'M' timeframe to get the number of complete months in the period between two dates. ```plaintext DATEDIF(01/01/2001, 01/01/2002, "M") = 12 ``` -------------------------------- ### Show QC if QA + QB = 110, else show QD Source: https://www.convertcalculator.com/help/building/adding-show-hide-logic Conditionally show item QC when the sum of QA and QB equals 110. Otherwise, item QD will be shown. ```FS IF(QA + QB = 110, TRUE, FALSE) ``` ```FS QA + QB = 110 ``` ```FS IF(QA + QB = 110, FALSE, TRUE) ``` -------------------------------- ### Retrieve Place Details using Formulas Source: https://www.convertcalculator.com/help/building/elements/place These formulas can be used to extract specific details from a place question input. Assuming 'QA' is the reference for your place question. ```text QA_route QA_street_number QA_locality QA_sublocality QA_postal_code QA_province QA_country ``` -------------------------------- ### Create Date - DATE(year, month, day) Source: https://www.convertcalculator.com/help/functions/date-functions Creates a valid date from year, month, and day components. All arguments must be numeric. The function adjusts dates if month or day values are out of range. ```plaintext DATE(year, month, day) ``` -------------------------------- ### FormulaScript Lambda Function (No Arguments) Source: https://www.convertcalculator.com/help/functions/formulascript Create and immediately call a custom function that accepts no arguments. This example returns the value 2. ```FormulaScript FUNCTION(1 + 1)() ``` -------------------------------- ### Filter Numbers with FILTER Function Source: https://www.convertcalculator.com/help/functions/filter Example of using the FILTER function to keep only numeric values from an array. Requires the ISNUMBER function. ```FS FILTER(ARRAY(1, 2, -5, 'string', ARRAY(), true), ISNUMBER) // -> [1, 2, -5] ``` -------------------------------- ### Reinitialize Calculator Instance Source: https://www.convertcalculator.com/help/embedding/embedding-appearance-issues Use this method when opening a modal to ensure the calculator is displayed correctly. This is an alternative to calling `window.ccInstance.reload()`. ```javascript window.cc.reinitialize() ``` -------------------------------- ### Variable FS: Base Price Calculation Source: https://www.convertcalculator.com/help/tutorials/cleaning-business-price-quote-calculator Calculates the base price by subtracting a discount (QA * QB) from an initial value (QA). ```FS FS QA - QA * QB ``` -------------------------------- ### Get Current Date - TODAY() Source: https://www.convertcalculator.com/help/functions/date-functions Returns the current date as a text string. The date is based on UTC time and requires no arguments. ```plaintext TODAY() ``` -------------------------------- ### Filter Positive Numbers with FILTER Function Source: https://www.convertcalculator.com/help/functions/filter Example of using the FILTER function with a custom anonymous function to keep only non-negative values from an array. ```FS FILTER(ARRAY(-5, -3, 3, 5, 100, -100, 0), function(x: x >= 0)) // -> [3, 5, 100, 0] ``` -------------------------------- ### CONVERTCURRENCY Function Syntax Source: https://www.convertcalculator.com/help/functions/convertcurrency-function This is the general syntax for the CONVERTCURRENCY function, outlining its parameters: value, from_currency, and to_currency. ```FS CONVERTCURRENCY(value, from_currency, to_currency) ``` -------------------------------- ### Returning the label of selected options Source: https://www.convertcalculator.com/help/building/elements/order-list Use the QX{label} reference in a formula to return the label of the selected option(s) in an order list question. ```formula QX{label} ``` -------------------------------- ### Calculate Months Difference (Ignoring Days and Years) Source: https://www.convertcalculator.com/help/functions/datedif Use the 'YM' timeframe to get the difference in months, disregarding the days and years in the period. ```plaintext DATEDIF(01/01/2001, 30/06/2002, "YM") = 5 ``` -------------------------------- ### Fraction Formatting with TEXT() Source: https://www.convertcalculator.com/help/functions/text-function Display decimal numbers as fractions using specific formats like '# ?/?', '# 4/?', or '# ?/4'. ```text-function TEXT(4.340381685, "# ?/?") ``` ```text-function TEXT(4.340381685, "# ?/2") ``` ```text-function TEXT(4.340381685, "# ??/100") ``` -------------------------------- ### Calculate Days Difference (Ignoring Months and Years) Source: https://www.convertcalculator.com/help/functions/datedif Use the 'MD' timeframe to get the difference in days, disregarding the months and years in the period. ```plaintext DATEDIF(01/01/2001, 30/06/2002, "MD") = 29 ``` -------------------------------- ### Get Dynamic Value from GOOGLESHEET Data Source: https://www.convertcalculator.com/help/functions/googlesheet-function Retrieve a value from GOOGLESHEET data dynamically based on QA and QB inputs, using the INDEX function. ```FS INDEX(GOOGLESHEET("spreadsheet_id", "sheet_id"), QA, QB) ``` -------------------------------- ### Using Google Sheets for Options Source: https://www.convertcalculator.com/help/building/options-from-formula This formula fetches options from a specific Google Sheet using its ID and a gid. ```FS GOOGLESHEET("1qYJVonS_caYCc1diSOYb0HM-s5nUyxW6PsfsvzIoJK9I", "2050638375") ``` -------------------------------- ### Exact Match VLOOKUP Example Source: https://www.convertcalculator.com/help/building/formulas/using-datasheets/vlookup-function Looks up the exact value 'Question A' in the first column of 'Datasheet A' and returns the corresponding value from the second column (index 1). ```Formula VLOOKUP(QA, DA, 1, 0) ``` -------------------------------- ### Percentage Formatting with TEXT() Source: https://www.convertcalculator.com/help/functions/text-function Format numbers as percentages by including a '%' symbol in the format string. The number is multiplied by 100 before formatting. ```text-function TEXT(0.8943, "0.00%") ``` -------------------------------- ### Leading Zeroes Formatting with TEXT() Source: https://www.convertcalculator.com/help/functions/text-function Demonstrates how TEXT() includes all integer digits in the final string, even when using leading zeroes in the format string. ```text-function TEXT(12, "0000##") ``` ```text-function TEXT(12, "0000#") ``` -------------------------------- ### OR Function: Basic Usage Source: https://www.convertcalculator.com/help/functions/or-function Demonstrates the OR function with two simple logical expressions comparing cell values to 50. Use this to check if either QA or QB exceeds 50. ```FS OR(QA > 50, QB > 50) ``` -------------------------------- ### Get Single Value from GOOGLESHEET Data Source: https://www.convertcalculator.com/help/functions/googlesheet-function Use the INDEX function with GOOGLESHEET to retrieve a specific value from the returned matrix. The first row and column are specified by 0, 0. ```FS INDEX(GOOGLESHEET("spreadsheet_id", "sheet_id"), 0, 0) ``` -------------------------------- ### Conditional Discount with AND and OR Source: https://www.convertcalculator.com/help/functions/if-function This snippet demonstrates how to apply a discount based on multiple conditions: the quantity of products and the product finish type. It uses AND to check if quantity is greater than 5 and OR to check if the finish is either silver or gold. ```Formula IF( AND(QB > 5, OR(QA = 100, QA = 200)), VA * 0.8, VA ) ``` -------------------------------- ### Extracting the 'result' field from API Response Source: https://www.convertcalculator.com/help/building/connect-api Use the GET function to extract the 'result' field from the API response object. The response data is only available after the button has been pressed. ```Calculator Formula GET(RESPONSE, "result") ``` -------------------------------- ### Show Layer Based on Multiple Conditions Source: https://www.convertcalculator.com/help/building/elements/layered-images Use this formula to show an image layer only when multiple conditions are simultaneously met. Both QA must equal 1 and QB must equal 2 for the layer to be displayed. ```Formula AND(QA = 1, QB = 2) ``` -------------------------------- ### Approximate Match VLOOKUP Example Source: https://www.convertcalculator.com/help/building/formulas/using-datasheets/vlookup-function Looks up the value 135 in the first column of 'Datasheet B' using approximate matching and returns the corresponding value from the third column (index 2). ```Formula VLOOKUP(135, DB, 2, 1) ``` -------------------------------- ### EDATE() Function Syntax Source: https://www.convertcalculator.com/help/functions/date-functions Use EDATE to calculate a date that is a specified number of months before or after a start date. The start_date must be a valid date or serial number, and months must be an integer. ```excel EDATE(start_date, months) ``` -------------------------------- ### Global Script for Asynchronous Loading Source: https://www.convertcalculator.com/help/embedding This script should be placed in the `` section of your website to load the calculator asynchronously. This prevents your page from blocking while the calculator code loads. ```HTML ``` -------------------------------- ### Convert a sum of variables from EUR to USD Source: https://www.convertcalculator.com/help/functions/convertcurrency-function This snippet demonstrates converting the sum of two variables (QA and QB) from Euros to US Dollars. ```FS CONVERTCURRENCY(QA + QB, 'EUR', 'USD') ``` -------------------------------- ### Creating a Dynamic Array with RANGE Source: https://www.convertcalculator.com/help/elements/charts Use the RANGE function to create a dynamic array where values update based on form inputs. It generates an array starting from a specified number up to a condition. ```FormulaScript RANGE(1, QA) ``` -------------------------------- ### FormulaScript Lambda Function (Single Argument) Source: https://www.convertcalculator.com/help/functions/formulascript Create and immediately call a custom function that accepts a single argument 'x'. This example adds 1 to the argument, returning 2 when called with 1. ```FormulaScript FUNCTION(x: x + 1)(1) ``` -------------------------------- ### IF() Function for Conditional Discount Source: https://www.convertcalculator.com/help/functions/if-function Applies a 5% discount if the total order value (QA * QB) exceeds $999. Otherwise, it returns the original total order value. ```FS IF( QB * QB > 999, QA * QB * 0.95, QA * QB ) ``` -------------------------------- ### Sort Table by Age Column Ascending Source: https://www.convertcalculator.com/help/functions/tablesort-function Use this example to sort a table named TA by the 'Age' column (the second column) in ascending order. The default sort order is ascending if not specified. ```excel TABLESORT(TABLE(TA), B) ```