View Single Post
 
Old 03-02-2020, 07:55 AM
mode1111 mode1111 is offline Windows 10 Office 2016
Novice
 
Join Date: Mar 2020
Posts: 3
mode1111 is on a distinguished road
Default Mail merge rounding error for times?

Hi all,

So I'm using mail merge to transfer time data from excel to word. The format I input to excel is HH:mm AM/PM.
It originally did have a computing problem when both excel and word were open at the same time, giving a decimal number instead of time, so now I use this:

{QUOTE{SET tval{MERGEFIELD Time_sampled}} {IF tval="?:*" {tval \@ "HH:mm"}"
{IF tval="??:*"{tval \@ "HH:mm"}"{=INT(tval*24) \#00}:{=INT(60*((tval*24)-INT(tval*24))) \#00}"}"}}

which basically should (hopefully) turn any "decimal time" into normal time in HH:mm (without the AM/PM...that didn't work for some reason). It works well except for one thing: all minutes are shifted by 1 minute down, so a 3:25 PM in excel will transfer to word as 15:24.
I've also noticed that this problem occurs only when you open the excel first and then the word but disappears if you open the word first and then excel...problem is that then excel is "read-only".
So if anyone can help me with this bizarre issue... I have no idea what to change.

Thanks so much in advance,
Alex.
Reply With Quote