Use PileCalc in Excel
Run any analysis from a spreadsheet with a generated WEBSERVICE() formula — inputs in cells, results that recalculate live.
Every analysis tool has a Excel button (Pro/Business) that generates a spreadsheet formula reproducing the on-screen result through the API. Your inputs live in cells; edit a diameter or a load and the result recalculates — no add-in, no VBA, no install.
How it works
- Run an analysis in the app, then click Excel in the toolbar and choose which result value(s) the formula should return.
- Paste the generated formula into any cell of a worksheet.
- Put your API key in
B1(create one under Settings → API keys). - Fill the input cells (
B2,B3, …) with the values listed in the dialog — each cell is one numeric input of the analysis, labelled by its field path (e.g.pile.length,soil.layers.0.gamma).
The formula then calls the PileCalc API with exactly the same request the app sent, and the cell shows the selected result. Values are SI, matching the app and the API reference.
Excel for Windows
WEBSERVICE() and ENCODEURL() are available in Excel 2013+ on Windows and Microsoft 365. They are not available in Excel for Mac or Excel on the web — use Google Sheets or the REST API from a script there.
The generated formula
A generated formula has this shape (abbreviated):
=WEBSERVICE("https://api.pilecalc.com/v1/lateral?key="&B1&"&req="
&ENCODEURL("{""pile"":{""kind"":""uniform"",""length"":")&B2
&ENCODEURL(",""diameter"":")&B3
… more chunks …
&"&fields=head.deflection")- The request JSON is split into
ENCODEURL(…)chunks with your input cells spliced between them, so every number stays editable. WEBSERVICE()returns text. Wrap the formula inVALUE(…)to get a number, e.g.=VALUE(WEBSERVICE(…)).- If you selected several fields the response is one comma-separated line — split it with
=TEXTSPLIT(WEBSERVICE(…), ",")(Excel 365) to spill each value into its own cell.
The GET endpoint
The formula uses the GET variant of each analysis endpoint, added for callers that cannot send HTTP headers:
GET https://api.pilecalc.com/v1/<type>?key=<api_key>&req=<url-encoded JSON>&fields=<paths>key— your API key. (Everywhere else, prefer theAuthorization: Bearerheader; a key in a URL can end up in access logs.)req— the URL-encoded JSON request body, identical to thePOST /v1/<type>body and validated by the same schema.fields— optional. Without it the endpoint returns the full JSON response; with it,text/plainCSV (see below).
Authentication, plan gating and metering are identical to the POST endpoints — each call counts once against your monthly quota, and recalculation re-issues the call.
Selecting result fields
fields is a comma-separated list of dot paths into the response. Numeric segments index arrays. A single path returns a bare value; several return one CSV line in the order given.
fields=head.deflection → 0.0123
fields=head.deflection,maxMoment.value → 0.0123,142.5
fields=nodes.10.moment → the moment at the 11th nodeA path that doesn't exist, or that resolves to an object or array, returns a 400 validation_error naming the bad path.
Google Sheets
Sheets has no WEBSERVICE(), but IMPORTDATA() fetches a URL and parses CSV — which is exactly what the GET endpoint returns with fields. Build the URL with string concatenation and ENCODEURL(…):
=IMPORTDATA("https://api.pilecalc.com/v1/lateral?key=" & B1
& "&req=" & ENCODEURL(B2) // B2 holds the JSON request as text
& "&fields=head.deflection,maxMoment.value")The simplest Sheets setup keeps the whole JSON request in one cell (copy it from the API dialog) rather than splicing per-input cells. Note that Sheets caches IMPORTDATA results for a while and limits calls per sheet.
Limits & troubleshooting
- URL length. Excel caps
WEBSERVICE()URLs around 2,048 characters. Large soil profiles can exceed it — the dialog warns you when a request gets close. Trim layers or optional inputs, or use the POST API from a script instead. - #VALUE! usually means the URL was too long, a cell is empty/non-numeric, or the request failed validation. Paste the URL parts into a browser to see the API's error message.
- Quota. Every recalculation is one API call against your plan's quota. Excel recalculates external functions on workbook open and when a referenced cell changes.
- Security. Anyone who can read the workbook can read the API key in
B1. Treat shared workbooks accordingly and revoke keys from Settings → API keys if leaked.