Assistance Required: Creating a Simple Product Formula with Mergefield

Hello,

I'm having trouble with a MergeField formula to calculate a product. My table has three columns:

1) Packs

2) Quantity

3) Total Packs (which should be Packs multiplied by Quantity)

Despite my efforts, I'm getting a syntax error.

Here's the formula I'm using:

IF " MERGEFIELD AdditionalAttribute1 «AdditionalAttribute1»"="" "" =( MERGEFIELD Quantity \#,##0.00«Quantity»* MERGEFIELD AdditionalAttribute1 «AdditionalAttribute1»)\#,##0.00}}

If needed, I can share the document to help troubleshoot.

Thanks,

Hi there,

I’d be happy to help you with your MergeField formula.

First, let’s break down the syntax error issue. Your formula looks a bit complicated, so let’s simplify it step by step.

Here’s a rewritten version of your formula, which should work:

={ MERGEFIELD Quantity \#,##0.00 } * { MERGEFIELD AdditionalAttribute1 \#,##0.00 }

Here’s what I’ve done:

  1. Removed the IF statement: Since you’re trying to calculate the product, we can directly multiply the two fields.
  2. Removed the empty string check: If either of the fields is empty, the product will be zero anyway.
  3. Wrapped each MergeField with curly braces: This is the correct syntax for using MergeFields in calculations.
  4. Removed the HTML tags: MergeFields don’t need HTML tags.

Try replacing your formula with this one and see if it works. If you still get a syntax error, please share the document as you offered, and I’ll be happy to take a closer look.

Additionally, here are some general tips when working with MergeFields in Word:

  • Make sure to enclose each MergeField in curly braces {}.
  • Use the correct syntax for the field format (e.g., \#,##0.00 for numbers).
  • Avoid mixing MergeFields with other text or formatting within the formula.

Let me know if this helps