Page 3 of 3 FirstFirst 123
Results 31 to 36 of 36
  • Thread Tools
  1. Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    3,303
    Thanks
    0
    Thanked 93 Times in 91 Posts

    Re: Word Field Maths (1.3)

    Hi Jay,

    Try:
    {={MERGEFIELD field1 }+{ MERGEFIELD field2 } # "Pos;Neg"}
    or
    {={MERGEFIELD field1 }+{ MERGEFIELD field2 } # "Pos;Neg;Nil"}
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  2. New Lounger
    Join Date
    Mar 2008
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Field Maths (1.3)

    macropod, both of those work! Thanks.

    thanks
    Jay

  3. New Lounger
    Join Date
    Mar 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Field Maths (1.3)

    recently discovered Macropod's fantastic Tips & Techniques for Date & Time Manipulation in MS Word.

    I had been looking for something similar for a long time - I needed a script to automatically insert a date 30 or 60 days from today to include in my invoice templates. My problem, however, is that Macropod's script works perfectly with a delay of 14 days, as in his example, but when I insert 30 or 60 instead of 14 in the script, I get a date 33 or 68 days from now.

    In a private reply, Macropod suggested that the reason might be that the regional date settings in my system (yyyy-MM-dd) are not handling the script correctly.

    I attach here a Word file which (on my system at least) shows this phenomenon.
    Attached Files Attached Files

  4. Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 10 Times in 10 Posts

    Re: Word Field Maths (1.3)

    Welcome to Woody's Lounge!

    See the screenshot below, it has Field Codes turned on in the View tab of Tools | Options. In your document, you have changed the value 14 in the definition of SET a{ ...} to match the delay, but that's not as it should be. The 14 in this definition is a fixed value. If you change it to 14 again, the field should return the correct dates.
    Attached Images Attached Images
    • File Type: png x.png (6.5 KB, 5 views)

  5. New Lounger
    Join Date
    Mar 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Field Maths (1.3)

    Thanks a lot!! This is the kind of error you make when you don't understand the script...

    Hans

  6. Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    3,303
    Thanks
    0
    Thanked 93 Times in 91 Posts

    Word Field Maths (1.4)

    Attached is a document I've created to show how to do various mathematical calculations using Word fields, including some possibilities for string testing & manipulation. Topics covered include:

    Formula Field Syntax
    Formula Field Arithmetic Operators
    Formula Field Comparison Operators
    Formula Field Functions
    Formula Field Logical Functions
    . AND And OR: Testing Multiple Logical Numeric Expressions
    . Testing Negative Numbers
    . Testing Or Returning Text Strings With Logical Functions In Bookmarks
    Calculations In Word Forms
    Referencing Cells In A Table
    . Identifying Cell Addresses
    . Referencing Cells Containing Numbers
    . Referencing Cells Containing Text
    . Reference Operators
    . Referencing An Entire Row Or Column
    . Referencing Adjacent Cells In A Row Or Column
    . Relative Referencing In Tables
    . Testing Or Returning Cell Contents In Tables
    . Reference Table Cells From Outside The Table
    . Referencing Row And Column Totals From Outside A Table
    Formatting Numeric Field Results
    Rounding Numbers To The Nearest Multiple
    Rounding Numbers Up Or Down
    Superscripted Ordinal Numbers
    Parse Numbers Separated By + Or - Signs
    Scientific Notation
    Logarithms
    Trigonometry
    Calculate Horizon Distances Using Word Fields
    Financial Calculations


    Feedback welcome,

    Cheers
    Attached Files Attached Files
    Last edited by macropod; 2011-02-02 at 21:55. Reason: Updated Attachment
    Cheers,

    Paul Edstein
    [MS MVP - Word]

Page 3 of 3 FirstFirst 123

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •