Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-30-2019, 10:29 AM
shawn.low@cox.net shawn.low@cox.net is offline Simple Calculation with a Merge Field Windows 10 Simple Calculation with a Merge Field Office 2016
Novice
Simple Calculation with a Merge Field
 
Join Date: May 2019
Location: Aliso Viejo, CA.
Posts: 24
shawn.low@cox.net is on a distinguished road
Default Simple Calculation with a Merge Field

Good Morning,




I am trying to write the code that takes a merge field, and subtracts 1, and displays the result.
Here is what I have, does it look correct?


{{= {MERGEFIELD TableStart:BorrowerProductQuery \*MERGEFORMAT}{MERGEFIELD Selected_Product_Term_Months \* MERGEFORMAT}{MERGEFIELD TableEnd:BorrowerProductQuery \*MERGEFORMAT} - 1 \# "0" *MERGEFORMAT}}


I am using Conga Composer to "build" the Word Doc, and the Merge Field is coming from a Conga Query, hence the "TableStart" & "TableEnd" merge fields.
The actual field value I need is called "Term_Months".


An example is, if the "term" of a loan is 60 months (This is the value in the field Term_Months), I need need the formula to return a value of "59".


I hope this makes sense.
Is the formula correct?


Thanks Paul,
Shawn Low

Reply With Quote
  #2  
Old 12-30-2019, 10:54 AM
shawn.low@cox.net shawn.low@cox.net is offline Simple Calculation with a Merge Field Windows 10 Simple Calculation with a Merge Field Office 2016
Novice
Simple Calculation with a Merge Field
 
Join Date: May 2019
Location: Aliso Viejo, CA.
Posts: 24
shawn.low@cox.net is on a distinguished road
Default Formula is not correct

Do here is what I get when I generate the Doc:


{ = 120 - 1 \# "0" * MERGEFORMAT }


So, obviously something is wrong.
The value of 120 that is showing, is actually the correct "term" in the test case Im using.
The formula is not actually doing the math (120 - 1) and showing 119.


Should I be using the {QUOTE} functionality?


Thanks
Shawn
Reply With Quote
  #3  
Old 12-30-2019, 11:17 AM
shawn.low@cox.net shawn.low@cox.net is offline Simple Calculation with a Merge Field Windows 10 Simple Calculation with a Merge Field Office 2016
Novice
Simple Calculation with a Merge Field
 
Join Date: May 2019
Location: Aliso Viejo, CA.
Posts: 24
shawn.low@cox.net is on a distinguished road
Default Working Now

Through trial and error, I managed to get this working correctly.


The formula that worked looks like this:


{ = {MERGEFIELD TableStart:YourCongaQuery \*MERGEFORMAT}{MERGEFIELD Your_Merge_Field \* MERGEFORMAT}{TableEnd:YourCongaQuery \*MERGEFORMAT} - 1 \# "0" \*MERGEFORMAT}


For those "Not" using Conga Composer to generate your document, simply take out the two (2) Merge Fields "TableStart" & "TableEnd". The formula would look like this:


{ = {MERGEFIELD Your_Merge_Field \*MERGEFORMAT} -1 \# "0" *MERGEFORMAT}


Thanks
Shawn
Reply With Quote
  #4  
Old 01-01-2020, 03:49 AM
macropod's Avatar
macropod macropod is offline Simple Calculation with a Merge Field Windows 7 64bit Simple Calculation with a Merge Field Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Delete the \*MERGEFORMAT switches - they add nothing useful here.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
math, merge field

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple Calculation with a Merge Field How to prevent the auto-calculation of the '% Complete' field in MS Project Professional 2013? VivekG1 Project 1 02-06-2015 05:33 AM
Simple Calculation with a Merge Field Trying to round up a field based on a calculation but getting error messages bakerrl Excel 19 10-14-2014 05:44 AM
Simple Calculation with a Merge Field Form field calculation returning 2x correct result Jschueller Word 1 08-20-2013 01:51 PM
Prevent Field Calculation with Dates from introducing line break? ztag Word 1 01-13-2012 04:13 PM
Simple Calculation with a Merge Field Mail Merge Calculation Error Lsbutler2000 Mail Merge 1 06-22-2007 06:33 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:43 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft