Calculate elapsed time in Word table?

J

jeff m

Hello. Is there a relatively easy way to have a formula in one cell show the
product of subracting the time in cell B minus cell A? I know how to do this
in Excel but would appreciate guidance about doing this in Word 2007.
Thanks!
 
D

Doug Robbins - Word MVP

The easiest thing would be to insert an Excel spreadsheet into the Word
document.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
M

macropod

Or using text formfields, with the document protected for forms, and an 'on exit' macro to do the calculation and insert the result
into the required cell (eg via another formfield). A suitable 'on exit' macro might look like:
Sub TimeDiff()
With ActiveDocument
.FormFields("Text3").Result = _
Format(CDate(.FormFields("Text1").Result) - CDate(.FormFields("Text2").Result), "HH:mm")
End With
End Sub
 
J

jeff m

Thank you, everyone! Jeff
--
Jeff Matranga


macropod said:
Hi Jeff,

Yes, provided you've only got one calculation to do. The formula is far from simple though! To see what I mean, check out my
Microsoft Word Date Calculation Tutorial, at:
http://lounge.windowssecrets.com/index.php?showtopic=249902
or
http://www.gmayor.com/downloads.htm#Third_party
In particular, look at the item titled 'Add Or Subtract Two Time Periods'. Do read the document's introductory material.

--
Cheers
macropod
[Microsoft MVP - Word]


jeff m said:
Hello. Is there a relatively easy way to have a formula in one cell show the
product of subracting the time in cell B minus cell A? I know how to do this
in Excel but would appreciate guidance about doing this in Word 2007.
Thanks!

.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top