Workbookery lets a Gravity Forms form use the math in your Excel workbook. Visitors fill in the form. Your workbook does the math on your own server. The result goes into a form field.
You need:
– WordPress 7.0 or newer
– PHP 8.2 or newer (tested on PHP 8.5)
– Gravity Forms 3.0 or newer, installed and active (tested on Gravity Forms 3.2)
– At least 128 MB of PHP memory
– An Excel workbook saved as .xlsx
See Server requirements below for how to set the memory limits. Not sure about your setup? After you install, Workbookery → Tools & Logs → System check tells you what’s missing.
1. Install Workbookery
- Go to Plugins > Add New > Upload Plugin.
- Choose the Workbookery .zip file. Click Install Now, then Activate.
- A Workbookery menu appears below Forms. It has Workbooks, Add Workbook, Connected Forms, Settings, Tools & Logs and License.
Data Tables is included with Workbookery, as a separate plugin. You don’t need it for this guide. To use it, install it the same way, after Workbookery is active. If Gravity Forms or Workbookery isn’t active, admins see a notice and Data Tables doesn’t start.
2. Make a small workbook
- Open a new workbook in Excel.
- Type
10 in cell B1 and 5 in cell B2.
- In B3, type
=B1*B2.
- Click B1. In the Name Box (left of the formula bar), type
input_price and press Enter.
- Name B2
input_qty and B3 output_total the same way.
- Save it as Excel Workbook (.xlsx).
Each name must point at one cell. Cells that get answers hold plain values. Cells that send results hold formulas. See Preparing your workbook for more.
3. Add the workbook
- Go to Workbookery → Add Workbook.
- Choose your .xlsx file. You can give it a Title. If you leave it blank, the file name is used.
- Click Add workbook.
- The steps are Uploading, Checking safety, then Finding named ranges.
- When it’s done, you see: “Workbook added. Next: connect it to a form.”
- Open the workbook’s Named ranges tab. You should see
input_price, input_qty and output_total.
- Optional: open Test calculation, enter 4 and 3, and click Run test. You should get 12. Nothing is saved. This is only a test.
4. Build the form
- Go to Forms > New Form.
- Add two Number fields: “Price” and “Quantity”.
- Add a field for the result, like a Number field named “Total”.
– Don’t make it Required.
– Don’t turn on Gravity Forms’ own calculation for it.
– To keep the result without showing it, use a Hidden field instead.
- Save the form.
5. Connect the form
- Go to Workbookery → Connected Forms and click Connect a form.
- Choose your form and your workbook. You finish the connection in the form’s settings.
- Type a Connection name, like “Price calculator”.
- Click Suggest matches. Then check each row:
– Under Send form answers to the workbook: Price → input_price, Quantity → input_qty.
– Under Put workbook results in form fields: output_total → Total.
- Turn on Show as read-only on the form for Total. Visitors can see the total but can’t type over it.
- Under If a calculation fails, keep Stop the submission and show a message.
- Save. You see “Connection saved.”
See Connecting a form for every setting on this screen.
6. Try it
- Preview the form. Enter 4 and 3. Submit.
- Go to Forms > Entries and open the new entry. “Total” should show 12.
- To show the result in a confirmation or notification, use the Total field’s merge tag.
The time a successful calculation took is saved on the entry as gfxl_calc_seconds. It is not shown in the entry list and is not included in a CSV export. You can read it through the Gravity Forms REST API or GFAPI if you can already view that entry.
Want visitors to see the result before they submit? Turn on Show results live as visitors type in the connection. It stays off until you turn it on. The result is always worked out again when the visitor submits.
Server requirements
Workbookery needs PHP 8.2 or newer (tested on PHP 8.5), WordPress 7.0 or newer, Gravity Forms 3.0 or newer, and at least 128 MB of PHP memory.
Set 128M on both PHP memory_limit and WordPress WP_MEMORY_LIMIT. Front-end form submissions use WP_MEMORY_LIMIT, not the higher memory WordPress sometimes gives the admin area. Also set WP_MAX_MEMORY_LIMIT for admin workbook uploads.
In wp-config.php:
define('WP_MEMORY_LIMIT','128M');
define('WP_MAX_MEMORY_LIMIT','128M');
Ask your host to set PHP memory_limit to 128M as well. Large, formula-heavy workbooks may need more. If the server actually runs out of memory during a calculation, visitors see a short message with a reference number and the failure is logged in Tools & Logs, instead of a blank page.
In 1.0.4.2, calculations use less memory — peak memory fell about 36% (33 vs 52 MiB) on a real production workbook — and run a little faster.
Didn’t work?
- Named range missing? Check the spelling in Excel under Formulas > Name Manager. Fix it, use Upload new version on the workbook, then switch the connection to the new version.
- Result field not in the list, or refused on save? Results can go into Number, Single Line Text, Paragraph Text and Hidden fields. Required fields, Number fields with a Gravity Forms calculation, and Product and Total fields show in the list, but saving them as a result is refused.
- “This named range is not a single cell…”? Each name must point at one cell.
- Upload refused? The message says why. Fix the file and try again. See What Workbookery can’t do.
- “Workbook files missing” after moving your site? Upload the file again from the Workbooks list.
- “Workbookery needs Gravity Forms 3.0 or newer…”? Gravity Forms is missing or not active. Install and activate it, then try again.
- “This site is running Gravity Forms …”? Your Gravity Forms is too old. Update it.
- “We couldn’t calculate your results…”? Note the reference. It starts with
WB-. Go to Workbookery → Tools & Logs. In the Logs section, type the reference in Show this reference and click Show this reference.
- “This form could not be calculated…”? A formula in the workbook gave an Excel error, like #DIV/0!. Log in as an administrator and submit again to see which result failed.
- “Enter a valid value.” or “Enter a valid date.”? The visitor’s answer can’t be read. Check the answer and try again.
- Still stuck? Run the System check on Workbookery → Tools & Logs. Then see License and support for how to get help.