Creating formulas in MathGrid

MathGrid allows you to perform powerful calculations directly within your InDesign tables. Creating a formula involves selecting a target cell for the result, inputting your calculation using cell references and operators, and then applying it.

Accessing the formula calculator

All formula creation takes place in the Calculator tab of the MathGrid plugin interface.

Step-by-step guide to creating a formula

  1. Select your target cell:
    In your InDesign document, place your cursor in the table cell where you want the result of your formula to appear.
  2. Set the target cell in MathGrid:
    In the MathGrid Calculator tab, click the Add to target button. This designates the selected InDesign cell as the destination for your formula's output. The cell reference (e.g., T1A1) will appear in the "Target cell" field.
  3. Write your formula:
    Enter your formula in the Formula input field. You can:
    • Type cell references directly (e.g., T1A1 + T1B1).
    • Click on cells in your InDesign document and then click the Add to formula button in MathGrid to insert their references into your formula.
    • Use the operator buttons (+, -, ×, ÷) provided in the plugin, or type them directly.
    • Incorporate text by enclosing it in double quotes (e.g., "Total: " + T1A1).
    • Use any of the available MathGrid functions (e.g., SUM(T1A1:T1A10)).
  4. Configure formula-specific formatting (optional):
    Before calculating, you can set formatting options for this specific formula's result:
    • Thousand separators: Check the "Use thousand separators" option if you want them (e.g., 1,000.00 or 1.000,00 depending on regional settings).
    • Decimal places: Adjust the number of decimal places for the result, or select "full" for no rounding.
  5. Apply the formula:
    Click the Calculate button. MathGrid will evaluate your formula and display the result in the designated target cell. The formula will also be registered and will automatically update if source cell values change (based on your update interval settings).

Understanding cell references (TnXm)

MathGrid uses a specific format for cell references: TnXm

  • T: Stands for "Table".
  • n: The story index number (starting from 1). A "story" in InDesign is a text frame or a chain of linked text frames. This number identifies which story (text frame) contains the table.
  • X: The column letter (A, B, C, etc.).
  • m: The row number (starting from 1).

Example: T1A1 refers to the cell in column A, row 1, of a table located in the first story (text frame) processed by MathGrid. T2B3 refers to column B, row 3, in a table within the second story.

Tip: When you select a cell in InDesign and click "Add to target" or "Add to formula", MathGrid automatically determines the correct TnXm reference.

Example formulas

  • Basic arithmetic: T1A1 + T1B1
  • Multiple operations: T1A1 + (T1B1 * T1C1) / T1D1
  • Using functions: SUM(T1A1:T1A10)
  • Combining with text: "Total: " + T1A1 or T1C5 + " units"
  • Referencing cells from different tables/stories: T1A1 + T2B3

Report issue

Features, Pricing, Documentation, Support, Login

MathGrid ©

Features,
Pricing,
Documentation,
Support,
Login

MathGrid ©

Back to top Arrow