{"id":3539,"date":"2026-11-29T12:02:14","date_gmt":"2026-11-29T12:02:14","guid":{"rendered":"https:\/\/help.goodgrants.com\/hc\/en-gb\/articles\/using-formula-fields\/"},"modified":"2026-11-29T14:00:48","modified_gmt":"2026-11-29T14:00:48","slug":"using-formula-fields","status":"publish","type":"post","link":"https:\/\/help.goodgrants.com\/hc\/en-gb\/articles\/using-formula-fields\/","title":{"rendered":"Using formula fields"},"content":{"rendered":"<style>\n  .fx-article table { width: 100%; border-collapse: collapse; table-layout: fixed; margin: 0; }<br \/>\n  .fx-article th, .fx-article td { padding: 10px 12px; border: 1px solid #d9dde3; text-align: left; vertical-align: top; line-height: 1.5; overflow-wrap: anywhere; word-break: break-word; }<br \/>\n  .fx-article th { background: #f4f6f8; font-weight: 600; }<br \/>\n  .fx-article th:first-child, .fx-article td:first-child { width: 45%; }<br \/>\n  .fx-article code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; background: #f4f6f8; padding: 1px 5px; border-radius: 4px; white-space: pre-wrap; }<br \/>\n  .fx-article pre { background: #f4f6f8; border: 1px solid #d9dde3; border-radius: 6px; padding: 12px 14px; overflow-x: auto; margin: 12px 0; }<br \/>\n  .fx-article pre code { background: none; padding: 0; white-space: pre; }<br \/>\n  .fx-article .table-wrap { width: 100%; overflow-x: auto; margin: 12px 0 24px; clear: both; }<br \/>\n  .fx-article td small { display: block; margin-top: 6px; color: #5b6470; }<br \/>\n  .fx-article td p { margin: 0; }<br \/>\n<\/style>\n<div class=\"fx-article\">\n<div class=\"premium-plan-gg\"><\/div>\n<p>Formula fields instantly perform calculations based on values entered into other fields on your application form. To create a formula, you\u2019ll need to reference the Short titles or slugs of the fields involved.<\/p>\n<h2 id=\"h_01KAV4ZY2JCMSH4JTJFE73ZHWX\">Configure a formula field<\/h2>\n<ol>\n<li>In the <strong>Manage<\/strong> workspace, go to <em>Applications<\/em><\/li>\n<li>Click <strong>Edit form<\/strong> and choose your form<\/li>\n<li>Find where you want to place your formula field, hover your cursor, and click the <strong>+<\/strong> icon<\/li>\n<li>In the configuration tray, choose <strong>Formula<\/strong> from the <strong>Field type<\/strong> drop-down<\/li>\n<li>Add a <strong>Label<\/strong> and <strong>Short title<\/strong><\/li>\n<li>(Optional) Add <strong>Hint text<\/strong> or <strong>Help text<\/strong> for added context<\/li>\n<li>In the &#8216;Options&#8217; section, enter your formula using the functions listed below<\/li>\n<li>Click <strong>Save<\/strong><\/li>\n<\/ol>\n<h2 id=\"h_01GRPNRBCKM91CTJNXR4P08BB9\">Available functions<\/h2>\n<p>The formula field supports a number of different functions, many of which will be familiar if you use formulas in Excel and other spreadsheet tools. Here are some examples of what you can do.<\/p>\n<h3 id=\"h_01HAPSETWZB8M92CQW0FG10Y9C\">Number and currency fields<\/h3>\n<div class=\"table-wrap\">\n<table>\n<thead>\n<tr>\n<th>Function<\/th>\n<th>Example<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>Average<\/strong><br \/>\nTakes the average of the specified fields<\/td>\n<td><code>average({field1},{field2},{field3},{field4})<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Sum<\/strong><br \/>\nSums the specified fields<\/td>\n<td><code>sum({field1},{field2},{field3},{field4})<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Min<\/strong><br \/>\nReturns the smallest number of the specified fields<\/td>\n<td><code>min({field1},{field2},{field3},{field4})<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Max<\/strong><br \/>\nReturns the largest number of the specified fields<\/td>\n<td><code>max({field1},{field2},{field3},{field4})<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Round<\/strong><br \/>\nRounds to specified number of decimal places<\/td>\n<td><code>round(number,count)<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Round up<\/strong><br \/>\nRounds up to specified number of decimal places<\/td>\n<td><code>roundup(number,count)<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Round down<\/strong><br \/>\nRounds down to specified number of decimal places<\/td>\n<td><code>rounddown(number,count)<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3 id=\"h_01HAPSETX0AGHAGJ82H8PZAFFM\">Strings<\/h3>\n<div class=\"table-wrap\">\n<table>\n<thead>\n<tr>\n<th>Function<\/th>\n<th>Example<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>Concatenate<\/strong><br \/>\nCombines several text strings into one string<\/td>\n<td><code>concatenate({field1},{field2},...{fieldn})<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Exact<\/strong><br \/>\nReturns true if both strings are exactly the same<\/td>\n<td><code>exact({field1},{field2})<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Left<\/strong><br \/>\nExtracts a given number of characters from the left side of a text string<\/td>\n<td><code>left({field},4)<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Lower<\/strong><br \/>\nConverts the text to lowercase<\/td>\n<td><code>lower({field})<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Mid<\/strong><br \/>\nReturns a substring of a given length starting from a specific position<\/td>\n<td><code>mid({field},start_position,length)<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Proper<\/strong><br \/>\nCapitalises the first word of a string<\/td>\n<td><code>proper({field})<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Replace<\/strong><br \/>\nReplaces a substring of a given string<\/td>\n<td><code>replace({field},start_position,length,\"new string\")<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Right<\/strong><br \/>\nExtracts a given number of characters from the right side of a text string<\/td>\n<td><code>right({field},4)<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3 id=\"h_01HAPSETX0NJA1JHZ52PXRG070\">Dates<\/h3>\n<div class=\"table-wrap\">\n<table>\n<thead>\n<tr>\n<th>Function<\/th>\n<th>Example<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>Today<\/strong><br \/>\nReturns today&#8217;s date<\/td>\n<td><code>today()<\/code><small>To format the date use:<\/small><code>text(today(),\"MM\/DD\/YYYY\")<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Days<\/strong><br \/>\nCalculates the difference between two date values<\/td>\n<td><code>days({field1},{field2})<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Month<\/strong><br \/>\nReturns the month for a date value<\/td>\n<td><code>month({field1})<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Year<\/strong><br \/>\nReturns the year for a date value<\/td>\n<td><code>year({field1})<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Day<\/strong><br \/>\nReturns the day for a date value<\/td>\n<td><code>day({field1})<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Edate<\/strong><br \/>\nShifts the date by the given number of months<\/td>\n<td><code>edate({date},months)<\/code><small>To format the date use:<\/small><code>text(edate({start},3),\"dd\/mm\/yyyy\")<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Hour<\/strong><br \/>\nReturns the hour for a given time<\/td>\n<td><code>hour({time})<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Now<\/strong><br \/>\nThe current date and time<\/td>\n<td><code>now()<\/code><small>To format use:<\/small><code>text(now(),\"dd\/mm\/yy hh:mm:ss\")<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Weekday<\/strong><br \/>\nReturns the number that corresponds to a day of the week<\/td>\n<td><code>weekday({field})<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Week number<\/strong><br \/>\nReturns the number that corresponds to the week of the year<\/td>\n<td><code>weeknum({field})<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Age<\/strong><br \/>\nReturns the age for a given date<\/td>\n<td><code>rounddown(days(today(),({DOB}))\/365,0)<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Countdown<\/strong><br \/>\nCalculates the days and hours until a given date and time<\/td>\n<td><code>days({Date 2}, {Date 1}) &amp; \" days, \" &amp; hour({Date 2}) - hour({Date 1}) &amp; \" hours\"<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3 id=\"h_01HAPSETX0YM2AVMJQ7VRJJ545\">Engineering<\/h3>\n<div class=\"table-wrap\">\n<table>\n<thead>\n<tr>\n<th>Function<\/th>\n<th>Example<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>bin2dec<\/strong><br \/>\nConverts a binary number to decimal<\/td>\n<td><code>bin2dec({field})<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>bin2hex<\/strong><br \/>\nConverts a binary number to hexadecimal<\/td>\n<td><code>bin2hex({field})<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>dec2bin<\/strong><br \/>\nConverts a decimal number to binary<\/td>\n<td><code>dec2bin({field})<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>dec2hex<\/strong><br \/>\nConverts a decimal number to hexadecimal<\/td>\n<td><code>dec2hex({field})<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>delta<\/strong><br \/>\nReturns true (1) if both numbers are equal, otherwise false (0)<\/td>\n<td><code>delta({field1},{field2})<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3 id=\"h_01HAPSETX0EMM3CXZJ2EMSAJ4Z\">Information<\/h3>\n<div class=\"table-wrap\">\n<table>\n<thead>\n<tr>\n<th>Function<\/th>\n<th>Example<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>isnumber<\/strong><br \/>\nReturns true if the field contains a number<\/td>\n<td><code>isnumber({field1})<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>iseven<\/strong><br \/>\nReturns true if the field contains an even number<\/td>\n<td><code>iseven({field})<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>isodd<\/strong><br \/>\nReturns true if the field contains an odd number<\/td>\n<td><code>isodd({field})<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>istext<\/strong><br \/>\nReturns true if the field contains text<\/td>\n<td><code>istext({field})<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3 id=\"h_01HAPSETX091T32422FXC9RAQ8\">Logical<\/h3>\n<div class=\"table-wrap\">\n<table>\n<thead>\n<tr>\n<th>Function<\/th>\n<th>Example<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>if<\/strong><br \/>\nIf\/then test<\/td>\n<td><code>if({field1}&gt;1000,\"then value1\", \"otherwise value2\")<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>and<\/strong><br \/>\nReturns true if all arguments are true<\/td>\n<td><code>and({num1}=3, {num2}=3)<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>or<\/strong><br \/>\nReturns true if at least one argument is true<\/td>\n<td><code>or({num1}=3, {num2}=3)<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2 id=\"h_01HAPSETWZPJSSHBA92K4B7Z86\">Example<\/h2>\n<p>If you want to calculate the year-on-year growth in revenue for two fields with short titles &#8220;2020&#8221; and &#8220;2021&#8221; you would reference each field as {2020} and {2021} in your formula. Here&#8217;s how it will look:<\/p>\n<pre><code>({2021}-{2020})\/{2020}*100<\/code><\/pre>\n<p>To round the result to two decimal places you can use the round function as follows:<\/p>\n<pre><code>round(({2021}-{2020})\/{2020}*100,2)<\/code><\/pre>\n<h2 id=\"h_01HAPSETX0NXXVN3P3ARJMT0V0\">Good to know<\/h2>\n<ul>\n<li>Formulas must be enclosed in curly braces: {}.<\/li>\n<li>Formulas are calculated client-side, meaning the calculation happens in the user\u2019s browser. Because of this, the formula field and any fields it references must be visible to the user viewing the page.<\/li>\n<li>All field types are supported except table fields, content fields, and other formula fields.<\/li>\n<li>Formula fields support up to 120 nested functions.<\/li>\n<li>When a radio button, checkbox list, or drop-down field has separate labels and values configured (for example, a label of &#8220;Colours&#8221; and a value of &#8220;A123&#8221;), you can return the underlying value in a formula field by simply entering in the field&#8217;s slug. This is useful when you want participants to select from readable text options while the corresponding codes are used internally.<\/li>\n<li>There is no need to add an equals sign at the start of a formula.<\/li>\n<li>When referencing a field in a formula, you can use either the field&#8217;s short title or its slug. The formula is saved referencing the slug, so if you later update a field&#8217;s short title, existing formulas will not break.<\/li>\n<li>Calculated values are saved to the application when the application is saved. This allows formula fields to be added as columns in views such as <em>Applications<\/em> in the <strong>Manage<\/strong> workspace.<\/li>\n<li>Updating a formula after applications already exist will automatically recalculate all stored values.<\/li>\n<\/ul>\n<p>To learn about other field types supported by Good Grants, check out our guide: <a href=\"360001955095\" target=\"_blank\" rel=\"noopener noreferrer\">Field types<\/a>.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Formula fields instantly perform calculations based on values entered into other fields on your application form. To create a formula, you\u2019ll need to reference the Short titles or slugs of the fields involved. Configure a formula field In the Manage workspace, go to Applications Click Edit form and choose your form Find where you want [&hellip;]<\/p>\n","protected":false},"author":27,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[1907,1879],"tags":[1383,1539,1785,1388],"class_list":["post-3539","post","type-post","status-publish","format-standard","hentry","category-11716164734479-04-field-configuration","category-11716113225359-pre-award","tag-calculation","tag-field","tag-formula","tag-sum"],"_links":{"self":[{"href":"https:\/\/help.goodgrants.com\/hc\/en-gb\/wp-json\/wp\/v2\/posts\/3539","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/help.goodgrants.com\/hc\/en-gb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/help.goodgrants.com\/hc\/en-gb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/help.goodgrants.com\/hc\/en-gb\/wp-json\/wp\/v2\/users\/27"}],"replies":[{"embeddable":true,"href":"https:\/\/help.goodgrants.com\/hc\/en-gb\/wp-json\/wp\/v2\/comments?post=3539"}],"version-history":[{"count":2,"href":"https:\/\/help.goodgrants.com\/hc\/en-gb\/wp-json\/wp\/v2\/posts\/3539\/revisions"}],"predecessor-version":[{"id":3884,"href":"https:\/\/help.goodgrants.com\/hc\/en-gb\/wp-json\/wp\/v2\/posts\/3539\/revisions\/3884"}],"wp:attachment":[{"href":"https:\/\/help.goodgrants.com\/hc\/en-gb\/wp-json\/wp\/v2\/media?parent=3539"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/help.goodgrants.com\/hc\/en-gb\/wp-json\/wp\/v2\/categories?post=3539"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/help.goodgrants.com\/hc\/en-gb\/wp-json\/wp\/v2\/tags?post=3539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}