#1
|
|||
|
|||
Mail Merge Field - Trying to divide time however receiving !Syntax, ;
Hello
I am merging to a csv dataset and have a field called 'TotalQuantity' and another called TotalPeople There are currently five sample records in my table... Total Quantity: 05:00, 05:00, 02:00, 10, 13 Total People: 5, 5, 2, 10, 13 I need to be able to divide the total quantity by total people.. I have created the {= {MERGEFIELD TotalQuantity } / {MERGEFIELD TotalPeople} } However this returns a Syntax error. Please help! FYI, if I try and do it on excel, it works. So it isn't a formatting issue that I'm aware of. Thanks, Jake. |
#2
|
||||
|
||||
Are your field's internal braces (i.e. { }) created via Ctrl-F9? You can't just type them.
Furthermore, it looks like some of your data are times, expressed in HH:mm. Unless your 'Total Quantity' is always a whole number of hours, you will not get meaningful results with your current approach, as Word's formula fields cannot evaluate times this way. A moderately-complicated field code would be needed to convert the time into minutes, do the division then convert the results back to HH:mm - {QUOTE{SET AvgTime {={={MERGEFIELD Total_Quantity \@ hh}*60}/{MERGEFIELD Total_People} \# 0}}{=INT(AvgTime/60)*100+MOD(AvgTime,60) \# "00:00"}} Note: The field brace pairs (i.e. '{ }') for the above example are all created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac); you can't simply type them or copy & paste them from this message. Nor is it practicable to add them via any of the standard Word dialogues.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mail Merge - Age field | jay_son | Mail Merge | 1 | 06-30-2014 02:33 PM |
time field issue in mail merge | Aude | Mail Merge | 16 | 05-18-2014 06:22 AM |
Mail merge how to link mail merge field value to a column heading | dsummers | Mail Merge | 1 | 05-08-2014 02:59 PM |
How to ignore a mail merge field if the field is blank | redzan | Mail Merge | 1 | 05-16-2013 08:34 AM |
How big can a mail merge field be? | Engineer | Mail Merge | 2 | 12-11-2012 01:20 AM |