Example formulas for MathGrid
To effectively utilize MathGrid's calculation power in your InDesign tables, explore the diverse formula examples presented here. They cover foundational arithmetic, text operations, function usage, and common practical applications.
Basic & advanced arithmetic
- Simple addition: T1A1 + T1B1
- Subtraction: T1C5 - T1D2
- Multiplication: T1E1 * T1F1
- Division: T1G10 / 2.5
- Order of operations (multiplication/division before addition/subtraction): T1A1 + T1B1 * T1C1 (T1B1 * T1C1 is calculated first)
- Using parentheses to control order of operations: (T1A1 + T1B1) * T1C1 (T1A1 + T1B1 is calculated first)
- Complex nested operations: ((T1A1 + T1B1) / (T1C1 - T1D1)) * T1E1
- Using negative numbers: T1A1 + (-T1B1) or T1A1 - T1B1
Text manipulation
- Combining text string with a cell value: "Total amount: " + T1A1
- Appending units to a cell value: T1C5 + " kg"
- Combining multiple cell values and strings: T1A1 + " " + T1B1 + " (ID: " + T1C1 + ")"
- Creating a descriptive label: "Report for Q" + T1D1 + " - Status: " + T1E1
Using functions
Functions allow for more powerful calculations on ranges of cells or individual values. Ensure you use the correct syntax for ranges (e.g., T1A1:T1A10 for a column range, or T1A1:T1E1 for a row range) or individual cells separated by commas for functions that accept multiple arguments.
- Summing a range of cells: SUM(T1A1:T1A10)
- Calculating the average of a range: AVERAGE(T1B1:T1B20)
- Counting cells that contain numbers in a range: COUNT(T1C1:T1C50)
- Finding the maximum value in a range: MAX(T1D1:T1D15)
- Finding the minimum value in a range: MIN(T1E1:T1E25)
Practical calculation examples
Financial calculations
- Calculating a line item total (Quantity * Unit Price): T1A2 * T1B2
- Calculating subtotal for multiple items: SUM(T1C1:T1C10) (assuming column C has line totals)
- Adding VAT/BTW (e.g., 21%): T1D1 * 1.21 (where T1D1 is subtotal) or T1D1 + (T1D1 * 0.21)
- Calculating a discount (e.g., 10% off): T1E5 * 0.90 (price after discount) or T1E5 - (T1E5 * 0.10) (discount amount)
- Gross Profit Margin: (Revenue - CostOfGoodsSold) / Revenue * 100, e.g., (T1A1 - T1B1) / T1A1 * 100 (as a percentage)
Percentages & ratios
- Calculating what percentage T1A1 is of T1B1: (T1A1 / T1B1) * 100
- Appending a percentage sign to the result: ((T1A1 / T1B1) * 100) + "%"
- Calculating percentage increase: ((NewValue - OldValue) / OldValue) * 100, e.g., ((T1C1 - T1D1) / T1D1) * 100
- Aspect ratio (width/height): T1W1 / T1H1 (assuming cells T1W1 for width, T1H1 for height)
Referencing cells from different tables
- Adding a value from Table 1 to a value from Table 2: T1A1 + T2B3
- Summing values from the same cell across different tables: SUM(T1A1, T2A1, T3A1)
Advanced logic
The following examples showcase more advanced logical functions.
- Simple conditional: IF(T1A1 > 10, "High", "Low")
- Nested conditional: IF(T1A1 > 100, "Large", IF(T1A1 > 50, "Medium", "Small"))
- Conditional with AND logic: IF(AND(T1A1 > 0, T1B1 = "Active"), "Process", "Hold")
- Conditional with OR logic: IF(OR(T1C1 = "Urgent", T1D1 < 5), "Priority", "Standard")
MathGrid ©
MathGrid ©