{"id":2197,"date":"2026-09-28T08:48:38","date_gmt":"2026-09-28T08:48:38","guid":{"rendered":"https:\/\/help.goodgrants.com\/hc\/en-us\/6358221628175-using-formula-fields\/"},"modified":"2026-11-28T14:23:59","modified_gmt":"2026-11-28T14:23:59","slug":"6358221628175-using-formula-fields","status":"publish","type":"post","link":"https:\/\/help.goodgrants.com\/hc\/en-gb\/6358221628175-using-formula-fields\/","title":{"rendered":"Using formula fields"},"content":{"rendered":"<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?ll 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 data-list-item-id=\"ec19c8df16b11910e7a77066625c75fc1\">In the <strong>Manage<\/strong> workspace, go to <em>Applications<\/em>\n<\/li>\n<li data-list-item-id=\"e46988d729ed0e6f35bf677fbdca8cd01\">Click <strong>Edit form<\/strong> and choose your form<\/li>\n<li data-list-item-id=\"e9818fc2c959d3914c171c1e5cfc8cf9d\">Find where you want to place your formula field, hover your cursor, and click the <strong>+<\/strong> icon<\/li>\n<li data-list-item-id=\"ef6d7b126df431731bfa8b6a5b547b0ac\">In the configuration tray, choose <strong>Formula<\/strong> from the <strong>Field type<\/strong> drop-down<\/li>\n<li data-list-item-id=\"eb76dfb3122958de2038b50480b3c7de3\">Add a <strong>Label<\/strong> and <strong>Short title<\/strong>\n<\/li>\n<li data-list-item-id=\"e8e80bb1b2e2d31115748004181d7172b\">(Optional) Add <strong>Hint text<\/strong> or <strong>Help text<\/strong> for added context<\/li>\n<li data-list-item-id=\"ef9bf8b398d193a55756280a0af673681\">In the &#8216;Options&#8217; section, enter your formula using the functions listed below<\/li>\n<li data-list-item-id=\"e0d515922ce9ba5bdd2dcb8a836b7aa6d\">Click <strong>Save<\/strong>\n<\/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<figure class=\"wysiwyg-table wysiwyg-table-align-left\" style=\"height: 198px; width: 100%;\">\n<table style=\"border-collapse: collapse; margin-left: 0px; margin-right: auto;\">\n<tbody>\n<tr style=\"height: 44px;\">\n<td style=\"height: 44px; width: 50%;\">\n<strong>Average<\/strong><br \/>Takes the average of the specified fields<\/td>\n<td style=\"height: 44px; width: 50%;\">average({field1},{field2},{field3},{field4})<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 50%;\">\n<strong>Sum<\/strong><br \/>Sums the specified fields<\/td>\n<td style=\"height: 22px; width: 50%;\">sum({field1},{field2},{field3},{field4})<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 50%;\">\n<strong>Min<\/strong><br \/>Returns the smallest number of the specified fields<\/td>\n<td style=\"height: 22px; width: 50%;\">min({field1},{field2},{field3},{field4})<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 50%;\">\n<strong>Max<\/strong><br \/>Returns the largest number of the specified fields<\/td>\n<td style=\"height: 22px; width: 50%;\">max({field1},{field2},{field3},{field4})<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 50%;\">\n<strong>Round<\/strong><br \/>Rounds to specified number of decimal places<\/td>\n<td style=\"height: 22px; width: 50%;\">round(number,count)<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 50%;\">\n<strong>Round up<\/strong><br \/>Rounds up to specified number of decimal places<\/td>\n<td style=\"height: 22px; width: 50%;\">roundup(number,count)<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 50%;\">\n<strong>Round down<\/strong><br \/>Rounds down to specified number of decimal places<\/td>\n<td style=\"height: 22px; width: 50%;\">rounddown(number,count)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>?<\/p>\n<h3 id=\"h_01HAPSETX0AGHAGJ82H8PZAFFM\">Strings<\/h3>\n<figure class=\"wysiwyg-table wysiwyg-table-align-left\" style=\"height: 110px; width: 100%;\">\n<table style=\"border-collapse: collapse; margin-left: 0px; margin-right: auto;\">\n<tbody>\n<tr style=\"height: 44px;\">\n<td style=\"height: 44px; width: 50%;\">\n<strong>Concatenate<\/strong><br \/>Combines several text strings into one string<\/td>\n<td style=\"height: 44px; width: 50%;\">concatenate({field1},{field2},&#8230;{fieldn})<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 50%;\">\n<strong>Exact<\/strong><br \/>Returns true if both strings are exactly the same<\/td>\n<td style=\"height: 22px; width: 50%;\">exact({field1},{field2})<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 50%;\">\n<strong>Left<\/strong><br \/>Extracts a given number of characters from the left side of a text string.<\/td>\n<td style=\"height: 22px; width: 50%;\">left({field},4)<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 50%;\">\n<strong>Lower<\/strong><br \/>Converts the text to lowercase<\/td>\n<td style=\"height: 22px; width: 50%;\">lower({field})<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 50%;\">\n<strong>Mid<\/strong><br \/>Returns a substring of a given length starting from a specific position<\/td>\n<td style=\"height: 22px; width: 50%;\">mid({field},start_position,length)<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 50%;\">\n<strong>Proper<\/strong><br \/>Capitalises the first word of a string<\/td>\n<td style=\"height: 22px; width: 50%;\">proper({field})<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 50%;\">\n<strong>Replace<\/strong><br \/>Replaces a substring of a given string<\/td>\n<td style=\"height: 22px; width: 50%;\">replace({field},start_position,length,&#8221;new string&#8221;)<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 50%;\">\n<strong>Right<\/strong><br \/>Extracts a given number of characters from the right side of a text string.<br \/>?<\/td>\n<td style=\"height: 22px; width: 50%;\">right({field},4)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>?<\/p>\n<h3 id=\"h_01HAPSETX0NJA1JHZ52PXRG070\">Dates<\/h3>\n<figure class=\"wysiwyg-table wysiwyg-table-align-left\" style=\"height: 240px; width: 100%;\">\n<table style=\"border-collapse: collapse; margin-left: 0px; margin-right: auto;\">\n<tbody>\n<tr style=\"height: 44px;\">\n<td style=\"height: 44px; width: 50%;\">\n<strong>Today<\/strong><br \/>Returns today&#8217;s date<\/td>\n<td style=\"height: 44px; width: 50%;\">today()?<br \/>To format the date use text(today(),&#8221;MM\/DD\/YYYY&#8221;)<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 50%;\">\n<strong>Days<\/strong><br \/>Calculates the difference between two date values<\/td>\n<td style=\"height: 22px; width: 50%;\">days({field1},{field2})<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 50%;\">\n<strong>Month<\/strong><br \/>Returns the month for a date value<\/td>\n<td style=\"height: 22px; width: 50%;\">month({field1})<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 50%;\">\n<strong>Year<\/strong><br \/>Returns the year for a date value<\/td>\n<td style=\"height: 22px; width: 50%;\">year({field1})<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 50%;\">\n<strong>Day<\/strong><br \/>Returns the day for a date value<\/td>\n<td style=\"height: 22px; width: 50%;\">day({field1},{field2})<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 50%;\">\n<strong>Edate<\/strong><br \/>Shifts the date by the given number of months<\/td>\n<td style=\"height: 22px; width: 50%;\">edate({date},months)<br \/>To format the date use text(edate({start},3),&#8221;dd\/mm\/yyyy&#8221;)<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 50%;\">\n<strong>Hour<\/strong><br \/>Returns the hour for a given time<\/td>\n<td style=\"height: 22px; width: 50%;\">hour({time})<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 50%;\">\n<strong>Now<\/strong><br \/>The current date and time<\/td>\n<td style=\"height: 22px; width: 50%;\">now()<br \/>To format use:<br \/>text(now(),&#8221;dd\/mm\/yy hh:mm:ss&#8221;)<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 50%;\">\n<strong>Weekday<\/strong><br \/>Returns the number that corresponds to a day of the week<\/td>\n<td style=\"height: 22px; width: 50%;\">weekday({field})<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 20px; width: 50%;\">\n<strong>Week number<\/strong><br \/>Returns the number that corresponds to the week of the year<\/td>\n<td style=\"height: 20px; width: 50%;\">weeknum({field})<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 50%;\">\n<p><strong>Age<\/strong><\/p>\n<p>Returns the age for a given date<\/p>\n<\/td>\n<td style=\"width: 50%;\">rounddown(days(today(),({DOB}))\/365,0)<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 50%;\">\n<p><strong>Countdown<\/strong><\/p>\n<p>Calculates the days and hours until a given date and time<\/p>\n<\/td>\n<td style=\"width: 50%;\">days({Date 2}, {Date 1}) &amp; &#8221; days, &#8221; &amp; hour({Date 2}) &#8211; hour({Date 1}) &amp; &#8221; hours&#8221;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>?<\/p>\n<h3 id=\"h_01HAPSETX0YM2AVMJQ7VRJJ545\">Engineering<\/h3>\n<figure class=\"wysiwyg-table wysiwyg-table-align-left\" style=\"height: 220px; width: 100%;\">\n<table style=\"border-collapse: collapse; margin-left: 0px; margin-right: auto;\">\n<tbody>\n<tr style=\"height: 44px;\">\n<td style=\"height: 44px; width: 49.7143%;\">\n<strong>bin2dec<\/strong><br \/>Converts a binary number to decimal<\/td>\n<td style=\"height: 44px; width: 50.2857%;\">bin2dec({field})<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 49.7143%;\">\n<strong>bin2hex<\/strong><br \/>Converts a binary number to hexadecimal<\/td>\n<td style=\"height: 22px; width: 50.2857%;\">bin2hex({field})<\/td>\n<\/tr>\n<tr style=\"height: 44px;\">\n<td style=\"height: 44px; width: 49.7143%;\">\n<strong>dec2bin<\/strong><br \/>Converts a decimal number to binary<\/td>\n<td style=\"height: 44px; width: 50.2857%;\">dec2bin({field})<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 49.7143%;\">\n<strong>dec2hex<\/strong><br \/>Converts a decimal number to hexadecimal<\/td>\n<td style=\"height: 22px; width: 50.2857%;\">dec2hex({field})<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 49.7143%;\">\n<strong>delta<\/strong><br \/>Returns true(1) if both numbers are equal otherwise false(0)<\/td>\n<td style=\"height: 22px; width: 50.2857%;\">delta({field1},{field2})<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>?<\/p>\n<h3 id=\"h_01HAPSETX0EMM3CXZJ2EMSAJ4Z\">Information<\/h3>\n<figure class=\"wysiwyg-table wysiwyg-table-align-left\" style=\"height: 220px; width: 100%;\">\n<table style=\"border-collapse: collapse; margin-left: 0px; margin-right: auto;\">\n<tbody>\n<tr style=\"height: 44px;\">\n<td style=\"height: 44px; width: 49.7143%;\">\n<strong>isnumber<\/strong><br \/>Returns true if the field contains a number<\/td>\n<td style=\"height: 44px; width: 50.2857%;\">isnumber({field1})<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 49.7143%;\">\n<strong>iseven<\/strong><br \/>Returns true if the field contains an even number<\/td>\n<td style=\"height: 22px; width: 50.2857%;\">iseven({field})<\/td>\n<\/tr>\n<tr style=\"height: 44px;\">\n<td style=\"height: 44px; width: 49.7143%;\">\n<strong>isodd<\/strong><br \/>Returns true if the field contains an odd number<\/td>\n<td style=\"height: 44px; width: 50.2857%;\">isodd({field})<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 49.7143%;\">\n<strong>istext<\/strong><br \/>Returns true if the field contains text<\/td>\n<td style=\"height: 22px; width: 50.2857%;\">istext({field})<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>?<\/p>\n<h3 id=\"h_01HAPSETX091T32422FXC9RAQ8\">Logical<\/h3>\n<figure class=\"wysiwyg-table wysiwyg-table-align-left\" style=\"height: 220px; width: 100%;\">\n<table style=\"border-collapse: collapse; margin-left: 0px; margin-right: auto;\">\n<tbody>\n<tr style=\"height: 44px;\">\n<td style=\"height: 44px; width: 49.7143%;\">\n<strong>if<\/strong><br \/>If\/then test<\/td>\n<td style=\"height: 44px; width: 50.2857%;\">if({field1}&gt;1000,&#8221;then value1&#8243;, &#8220;otherwise value2&#8221;)<\/td>\n<\/tr>\n<tr style=\"height: 22px;\">\n<td style=\"height: 22px; width: 49.7143%;\">\n<strong>and<\/strong><br \/>Returns true if all arguments are true<\/td>\n<td style=\"height: 22px; width: 50.2857%;\">and({num1}=3, {num2}=3)<\/td>\n<\/tr>\n<tr style=\"height: 44px;\">\n<td style=\"height: 44px; width: 49.7143%;\">\n<strong>or<\/strong><br \/>Returns true if at least one argument is true<\/td>\n<td style=\"height: 44px; width: 50.2857%;\">or({num1}=3, {num2}=3)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\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 class=\"wysiwyg-text-align-center wysiwyg-code-block\"><code class=\"language-auto\">({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 class=\"wysiwyg-text-align-center wysiwyg-code-block\"><code class=\"language-auto\">round(({2021}-{2020})\/{2020}*100,2)<\/code><\/pre>\n<h2 id=\"h_01HAPSETX0NXXVN3P3ARJMT0V0\">Good to know<\/h2>\n<ul>\n<li data-list-item-id=\"e9e32a664becd44de7c174184da85241a\">Formulas must be enclosed in curly braces: {}.<\/li>\n<li data-list-item-id=\"e33acc357afb4b7e40534bb48c0a21bde\">Formulas are calculated client-side, meaning the calculation happens in the user?s browser. Because of this, the formula field and any fields it references must be visible to the user viewing the page.<\/li>\n<li data-list-item-id=\"e27119a3741def4a70e98f9427fefc595\">All field types are supported except table fields, content fields, and other formula fields.<\/li>\n<li data-list-item-id=\"ef33a3ce1c72356c89e85390dd57120fd\">Formula fields support up to 120 nested functions.<\/li>\n<li data-list-item-id=\"ebb0f8711e74b42b4fbb528849559a0fa\">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 data-list-item-id=\"e9aa287e01148b61085096e512a316629\">There is no need to add an equals sign at the start of a formula.<\/li>\n<li data-list-item-id=\"e27c8bf08bc3ddc2e973854d0c0656a35\">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 data-list-item-id=\"ea367e2b3efb4c8c7edf1fcd33125572b\">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 data-list-item-id=\"e21fea8d0efe4a22e9b72c84326569679\">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=\"https:\/\/help.goodgrants.com\/hc\/en-gb\/articles\/360001955095\" target=\"_blank\" rel=\"noopener noreferrer\">Field types<\/a>.<\/p>\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?ll 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":[1297,1284],"tags":[1383,1539,1785,1388],"class_list":["post-2197","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\/2197","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=2197"}],"version-history":[{"count":1,"href":"https:\/\/help.goodgrants.com\/hc\/en-gb\/wp-json\/wp\/v2\/posts\/2197\/revisions"}],"predecessor-version":[{"id":2324,"href":"https:\/\/help.goodgrants.com\/hc\/en-gb\/wp-json\/wp\/v2\/posts\/2197\/revisions\/2324"}],"wp:attachment":[{"href":"https:\/\/help.goodgrants.com\/hc\/en-gb\/wp-json\/wp\/v2\/media?parent=2197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/help.goodgrants.com\/hc\/en-gb\/wp-json\/wp\/v2\/categories?post=2197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/help.goodgrants.com\/hc\/en-gb\/wp-json\/wp\/v2\/tags?post=2197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}